<?php
/**
 * 系統名稱: Lotto 系統
 * 檔案說明: 專案管理-修改
 * $Author$
 * $Id$
 *
 */

//取出此期賽程
$arrGamble = getNewGambleData($intLottoID, 0);
if($arrGamble === false){
	ErrMsgOutputHTML("Error", "", 1);
}
if(sizeof($arrGamble) == 0){
	$arrGamble = getNewGambleData($intLottoID, 1);
	if($arrGamble === false){
		ErrMsgOutputHTML("Error", "", 1);
	}
}
$intGID = $arrGamble["ID"];

if(!empty($intGID))$_strGDate = DateForm($arrGamble["GameDate"], $arrGamble["GameTime"], "Y-m-d", "UToC")."&nbsp;".TimeForm($arrGamble["GameDate"], $arrGamble["GameTime"], "h:i a", "UToC");

$arrTmp = split("-", $arrLotto["Number"]);
for($i = intval($arrTmp[0]); $i <= intval($arrTmp[1]); $i++)$_strNumber .= $i.",";
$_strNumber = substr($_strNumber, 0, strlen($_strNumber) - 1);

//$arrMaxOdds = array();
//$arrJumpOdds = array();
$arrBTTip = array();
for($i = 1; $i <= sizeof($_arrBetParam); $i++){
	$intTmpBT = $i;
	$arrBTTip[] = "arrBetType[".$intTmpBT."] = \"".$_arrBet_Type[$arrLotto["LType"]][$intTmpBT]."\"";
	//foreach($_arrBetParam[$i] as $intAN => $arrParam){
		//$arrMaxOdds[] = "MaxOdds[".$i."][".$intAN."] = ".$arrParam["maxOdds"];
		//$arrJumpOdds[] = "arrJumpOdds[".$i."][".$intAN."] = ".$arrParam["StakeJumpRate"];
	//}
}
?><!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title> <?php print $_strRealSupplement["Title"];?> (Add) </title>
<link rel="stylesheet" href="../../css/backend.css?time=01" type="text/css">
<link href="../../css/loto_lb.css?time=01" rel="stylesheet" type="text/css">
<script language="JavaScript1.2" type="text/javascript" src="/inc/RealSupplementTemp<?php print $_intLang?>.js?time=01"></script>
<script language="JavaScript1.2" type="text/javascript" src="/common/betparam/AnimalsParams_<?php print $intLottoID;?>.js?time=01"></script>
<script language="JavaScript1.2" type="text/javascript" src="/inc/admin_envirset.js"></script>
<script language="JavaScript1.2" type="text/javascript" src="/inc/cookie.js"></script>
<script language="JavaScript">
<!--
//var strLayer010203 = "", strLayer040506 = "", strLayer0711 = "", strLayer121314 = "", strLayer15 = "", strLayer1718 = "", strLayer1920 = "", strLayerStart = "";
var Game1 = new Array(), Game2 = new Array(), Game3 = new Array(), Game16 = new Array();
var Game4 = new Array(), Game5 = new Array(), Game6 = new Array();
var Game7 = new Array(), Game8 = new Array(), Game9 = new Array(), Game10 = new Array(), Game11 = new Array();
var Game12 = new Array(), Game13 = new Array(), Game14 = new Array(), Game27 = new Array();
var Game17 = new Array(), Game18 = new Array(), Game19 = new Array(), Game20 = new Array(), Game29 = new Array();
var Game21 = new Array(), Game22 = new Array(), Game23 = new Array(), Game24 = new Array(), Game25 = new Array(), Game26 = new Array();
var Game31 = new Array(), Game32 = new Array(), Game33 = new Array(), Game34 = new Array(), Game35 = new Array(), Game36 = new Array();
var Game37 = new Array(), Game38 = new Array(), Game39 = new Array(), Game40 = new Array(), Game41 = new Array(), Game42 = new Array(), Game43 = new Array();
var intSortPlus = -1;
var strLottoNum = "<?php print $_strNumber;?>";
var arrSpecialNum = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
var arrSpecialCon = new Array("", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "");
var BColor_Index = new Array(<?php print $arrLotto["ColorSet"];?>);
var BColor_Value = new Array("red","blue","green");
var strLottoID = "<?php print $intLottoID;?>";
var strBetType = "1,2,3,16";
var RSeconds = 0;
var AutoRefreshID = 0;
//正常下注用
var sumStake = 0, sumPayOff = 0, sumCommission = 0;
var sumOUStake = 0, sumOUPayOff = 0, sumOUCommission = 0;
var sumOEStake = 0, sumOEPayOff = 0, sumOECommission = 0;
var sumSOEStake = 0, sumSOEPayOff = 0, sumSOECommission = 0;
var arrOE16Stake = new Array(0, 0, 0, 0, 0, 0, 0), arrOE16PayOff = new Array(0, 0, 0, 0, 0, 0, 0), arrOE16Commission = new Array(0, 0, 0, 0, 0, 0, 0);
var arrOU16Stake = new Array(0, 0, 0, 0, 0, 0, 0), arrOU16PayOff = new Array(0, 0, 0, 0, 0, 0, 0), arrOU16Commission = new Array(0, 0, 0, 0, 0, 0, 0);
var arrColor16Stake = new Array(0, 0, 0, 0, 0, 0, 0), arrColor16PayOff = new Array(0, 0, 0, 0, 0, 0, 0), arrColor16Commission = new Array(0, 0, 0, 0, 0, 0, 0);
var arrSOU16Stake = new Array(0, 0, 0, 0, 0, 0, 0), arrSOU16PayOff = new Array(0, 0, 0, 0, 0, 0, 0), arrSOU16Commission = new Array(0, 0, 0, 0, 0, 0, 0);
var sumColorStake = 0, sumColorPayOff = 0, sumColorCommission = 0;
var sumAnimalsStake = 0, sumAnimalsPayOff = 0, sumAnimalsCommission = 0;
var arrHelfColorStake = new Array(0, 0), arrHelfColorPayOff = new Array(0, 0), arrHelfColorCommission = new Array(0, 0);
var arrSumStake = new Array(), arrSumPayOff = new Array(), arrSumCommission = new Array();
//補貨用
var sumSuppleStake = 0, sumSupplePayOff = 0, sumSuppleCommission = 0;
var sumSuppleOUStake = 0, sumSuppleOUPayOff = 0, sumSuppleOUCommission = 0;
var sumSuppleOEStake = 0, sumSuppleOEPayOff = 0, sumSuppleOECommission = 0;
var sumSuppleSOEStake = 0, sumSuppleSOEPayOff = 0, sumSuppleSOECommission = 0;
var arrSuppleOE16Stake = new Array(0, 0, 0, 0, 0, 0, 0), arrSuppleOE16PayOff = new Array(0, 0, 0, 0, 0, 0, 0), arrSuppleOE16Commission = new Array(0, 0, 0, 0, 0, 0, 0);
var arrSuppleOU16Stake = new Array(0, 0, 0, 0, 0, 0, 0), arrSuppleOU16PayOff = new Array(0, 0, 0, 0, 0, 0, 0), arrSuppleOU16Commission = new Array(0, 0, 0, 0, 0, 0, 0);
var arrSuppleColor16Stake = new Array(0, 0, 0, 0, 0, 0, 0), arrSuppleColor16PayOff = new Array(0, 0, 0, 0, 0, 0, 0), arrSuppleColor16Commission = new Array(0, 0, 0, 0, 0, 0, 0);
var arrSuppleSOU16Stake = new Array(0, 0, 0, 0, 0, 0, 0), arrSuppleSOU16PayOff = new Array(0, 0, 0, 0, 0, 0, 0), arrSuppleSOU16Commission = new Array(0, 0, 0, 0, 0, 0, 0);
var sumSuppleColorStake = 0, sumSuppleColorPayOff = 0, sumSuppleColorCommission = 0;
var sumSuppleAnimalsStake = 0, sumSuppleAnimalsPayOff = 0, sumSuppleAnimalsCommission = 0;
var arrSuppleHelfColorStake = new Array(0, 0), arrSuppleHelfColorPayOff = new Array(0, 0), arrSuppleHelfColorCommission = new Array(0, 0);
var arrSumSuppleStake = new Array(), arrSumSupplePayOff = new Array(), arrSumSuppleCommission = new Array();
var strBalanceText = "<?php print $_strRealSupplement["BalanceText"];?> ";
var strT1 = "<?php print $_strRealSupplement["SpecialNumber"];?>", strT4 = "<?php print $_strRealSupplement["NormalNumber"];?>", strT7 = "<?php print $_strRealSupplement["JoinNumber"];?>", strT12 = "<?php print $_strRealSupplement["NormalNumber1_6"];?>", strT15 = "<?php print $_strRealSupplement["NormalNumberParlays"];?>", strT17 = "<?php print $_strRealSupplement["AnimalsColor"];?>", strT19 = "<?php print $_strRealSupplement["AnimalsMantissa"];?>", strT21 = "<?php print $_strRealSupplement["NormalSpecial1"];?>", strT29 = "<?php print $_strRealSupplement["HelfColor"];?>", strT31 = "<?php print $_strRealSupplement["FiveNotWin"];?>", strT32 = "<?php print $_strRealSupplement["AnimalsJN"];?>", strT38 = "<?php print $_strRealSupplement["MantissaJN"];?>", strTSG = "<?php print $_strRealSupplement["StartGame"];?>";
var SpecialOverNumber = "<?php print $arrLotto["SpecialOverNumber"];?>";
var NormalOverNumber =  "<?php print $arrLotto["NormalOverNumber"];?>";
//var MaxOdds = new Array();
//var arrJumpOdds = new Array();
var arrBetType = new Array();
<?php 
//	print join("; ", $arrMaxOdds).";";
//	print join("; ", $arrJumpOdds).";";
	print join("; ", $arrBTTip).";";
?>
var arrAnimals = new Array(<?php print "'".join("','", $_arrAnimals)."'";?>);
var arrHelfColor = new Array(<?php 
	for($i = 0; $i < 12; $i++)print "'".$_strSame_String["SHelfColor".$i]."', ";
	print "''";
?>);
var arrJNSort = new Array();
var intSortSite = 0;
var isGetSuppleOdds = "Y<?php //print $_data["isGetSuppleOdds"];?>";
var strNumberDuplicate = "<?php print $_strRealSupplement["NumberDuplicate"];?>";

//正碼或特碼初始化
function iniNumber(intBetType){
	var arrNumber = new Array();
	if(intBetType == 1){
		document.all["ListStatus"].innerHTML = (document.getDataForm.SpecialNumType.value == "2" || document.getDataForm.SpecialNumType.value == "4")?strT1+"B":strT1+"A";
		document.all["BetList"].innerHTML = strLayer010203;
	}else if(intBetType == 4){
		document.all["BetList"].innerHTML = strLayer040506;
	}else if(intBetType == 31){
		document.all["BetList"].innerHTML = strLayer31;
	}else{
		document.all["BetList"].innerHTML = strLayer2126.replace(/2126/, intBetType);
		document.all["BetList"].innerHTML = document.all["BetList"].innerHTML.replace(/2126/, intBetType);
	}
	arrNumber = strLottoNum.split(",");
	for(var i = 1; i <= arrNumber.length; i++){
		document.all["Num"+i].innerHTML = "<a href=\"JavaScript:void(0)\" class=\"G_Con_Numer_"+BColor_Value[BColor_Index[i-1]]+"\" id=\"NumLink"+i+"\">" + ((i < 10)?"0"+i:i) + "</a>";
		document.all["OddsTD"+i].innerHTML = "<a class=\"G_Con_Odds_NoLink\">0</a><br /><a class=\"G_Con_Bet\" href=\"JavaScript:void(0)\">0/0</a>";
	}
	if(intBetType == 31){//(intBetType > 20 && intBetType < 27) || 
		GetOdds();
		return;
	}
	document.all["OddOddsTD"].innerHTML = "<a class=\"G_Con_Odds_NoLink\">0.00</a><br /><a class=\"G_Con_Bet\" href=\"JavaScript:void(0)\">0/0</a>";
	document.all["EvenOddsTD"].innerHTML = "<a class=\"G_Con_Odds_NoLink\">0.00</a><br /><a class=\"G_Con_Bet\" href=\"JavaScript:void(0)\">0/0</a>";
	document.all["OverOddsTD"].innerHTML = "<a class=\"G_Con_Odds_NoLink\">0.00</a><br /><a class=\"G_Con_Bet\" href=\"JavaScript:void(0)\">0/0</a>";
	document.all["UnderOddsTD"].innerHTML = "<a class=\"G_Con_Odds\">0.00</a><br /><a class=\"G_Con_Bet\" href=\"JavaScript:void(0)\">0/0</a>";

	var objWTable = document.all["MultiOddsTable"], intNum = 0, strNum = "";
	with(objWTable)	{
		while(rows.length > 1)	deleteRow(rows.length - 1);
		for(i =1; i <= 10; i++){
			newTR = insertRow();
			newTR.className = "s_multi_num";
			with(newTR){
				for (j = 0; j <= 4; j++){
					intNum = 10*j + i;
					strNum = NumFormat(intNum);
					if (intNum == 50) {
						newTD = insertCell();
						newTD.colSpan = 3;
						newTD.innerHTML = "&nbsp;";
					}else{
						newTD = insertCell();
						newTD.innerHTML = strNum;
						newTD.style.color = BColor_Value[BColor_Index[intNum-1]];
						newTD = insertCell();
						newTD.innerHTML = '<input type="text" name="arrOdds['+intNum.toString()+']" value="" maxlength="4" class="s_multi_num_odds"'+((isGetSuppleOdds == "Y")?' onkeydown="event.returnValue=false;" onfocus="this.blur();"':'')+'><input type="hidden" name="arrOID['+intNum.toString()+']" value="">';
						newTD = insertCell();
						newTD.innerHTML = '<input type="text" name="arrStake['+intNum.toString()+']" value="" class="s_multi_num_num"><input type="hidden" name="arrMaxStake['+intNum.toString()+']" value="">';
					}
				}
			}
		} // for(i =1; i <= 10; i++)
	} // with(objWTable)
	GetOdds();
}

function NumFormat(intNum){
	return (intNum < 10)?("0" + intNum.toString()):intNum.toString();
}

function changEmergency(){
	document.getElementById("EmergencyLink").innerHTML = (isEmergency == 0)?"<?php print $_strRealSupplement["EmergencyOff"];//緊急關閉?>":"<?php print $_strRealSupplement["EmergencyOpen"];//系統開放?>";
	document.getElementById("EmergencyLink").className = (isEmergency == 0)?"G_Con_Emergency_Off":"G_Con_Emergency_On";
}

function takeEmergency(){
	with(document.getDataForm){
		op.value = "OffAllWager";
		intEmergency.value = (isEmergency == 0)?"1":"0";
		submit();
	}
}

function changSort(){
	intSortPlus *= -1;
	changSortClass();
	RefreshType();
}

function changSortClass(){
	TenSortLink.innerHTML = (intSortPlus == -1)?"<?php print $_strRealSupplement["TenLoseSort"];//十大負值排行?>":"<?php print $_strRealSupplement["TenWinSort"];//十大正值排行?>";
	TenSortTD.className = (intSortPlus == -1)?"G_Con_SortLoseTD":"G_Con_SortWinTD";
}

function ValueSort(arrValue, intValue, intNum, strCon){
	var i = 0, intTmp = 0, intTmp2 = 0, isMoveDown = false;
	for(i = 0; i < arrValue.length; i++){
		if(isMoveDown == false){
			if(arrValue[i] < intValue){
				intTmp = arrValue[i];
				intNum1 = arrSpecialNum[i];
				strCon1 = arrSpecialCon[i];
				arrValue[i] = intValue;
				arrSpecialNum[i] = intNum;
				arrSpecialCon[i] = strCon;
				isMoveDown = true;
			}
		}else{
			if(isMoveDown == true){
				intTmp2 = arrValue[i];
				intNum2 = arrSpecialNum[i];
				strCon2 = arrSpecialCon[i];
				arrValue[i] = intTmp;
				arrSpecialNum[i] = intNum1;
				arrSpecialCon[i] = strCon1;
				intTmp = intTmp2;
				intNum1 = intNum2;
				strCon1 = strCon2;
			}
		}
	}
	return arrValue;
}

//顯示數字賠率，給 iframe 用
function ShowNumberOdds(isSpecial){
	var intNum = 0, strTD = "", strTip = "", arrTmpGame = new Array(), sumOdds = 0, minPayOff = 0, intTmp = 0, intTmp2 = 0, intBT, preWin = 0, preWin2 = 0, strClass = "", strCon = "", intBalance = 0, flOdds = 0, isReData = "", intStake = 0;// sumPayOff = 0,

	//數字
	if (isSpecial != 4) {
		var arrN = new Array(-1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000);
		arrTmpGame	= eval("Game"+isSpecial);
		intBT = isSpecial;
	} else {
		var arrN = new Array(0, 0, 0, 0, 0, 0);
		arrTmpGame 	= Game4;
		intBT = 4;
	}
	intBalance = parseInt(document.all.BalanceValue.value);
	isReData = document.MultiOddsLayer.isRefreshData.value;
	document.MultiOddsLayer.isRefreshData.value = "0";
	for(var i = 1; i < arrTmpGame.length; i++){
		flOdds = parseFloat(arrTmpGame[i][5]);
		intNum = eval(arrTmpGame[i][3]);
		sumOdds += 1 / parseFloat(arrTmpGame[i][5]);
		intTmp = parseFloat(arrTmpGame[i][9]) + parseFloat(arrTmpGame[i][8]);
		intTmp2 = parseFloat(arrTmpGame[i][13]) + parseFloat(arrTmpGame[i][12]);
		preWin2 = intTmp2 - sumSuppleStake + sumSuppleCommission; //派彩所得 - 總下注金額 + 所有退水
		preWin = sumStake - intTmp - sumCommission + preWin2;
		document.all["NumLink"+intNum].href = "JavaScript:intSortSite=0;ShowOddsLayer("+arrTmpGame[i][1]+", "+intBT+", "+intNum+", "+arrTmpGame[i][5]+", "+arrTmpGame[i][4]+","+Math.floor(parseFloat(arrTmpGame[i][8]) - parseFloat(arrTmpGame[i][12]))+","+((preWin < intBalance)?Math.floor((intBalance - preWin)/flOdds).toString():"0")+");";
		strCon = "<a class=\"G_Con_Odds_NoLink\" href=\"JavaScript:intSortSite=0;ShowOddsLayer("+arrTmpGame[i][1]+", "+intBT+", "+intNum+", "+arrTmpGame[i][5]+", "+arrTmpGame[i][4]+","+Math.floor(parseFloat(arrTmpGame[i][8]) - parseFloat(arrTmpGame[i][12]))+","+((preWin < intBalance)?Math.floor((intBalance - preWin)/flOdds).toString():"0")+")\">"+arrTmpGame[i][5]+"</a><br /><a class=\"G_Con_Bet\" href=\"JavaScript: intSortSite=0;getWagerData("+arrTmpGame[i][1]+","+arrTmpGame[i][2]+","+intNum+",0)\">"+arrTmpGame[i][11]+"/"+Math.round(parseFloat(arrTmpGame[i][12])).toString()+"</a>";
		if(isReData == "1"){
			document.MultiOddsLayer["arrOdds["+intNum+"]"].value = arrTmpGame[i][5];
			document.MultiOddsLayer["arrOID["+intNum+"]"].value = arrTmpGame[i][4];
			intStake = Math.floor((intBalance - preWin)/(flOdds*100))*100;
			document.MultiOddsLayer["arrStake["+intNum+"]"].value = (intStake > 0)?intStake:"";
			document.MultiOddsLayer["arrMaxStake["+intNum+"]"].value = Math.floor(parseFloat(arrTmpGame[i][8]) - parseFloat(arrTmpGame[i][12]));
		}

		document.all["Num"+intNum].className = (arrTmpGame[i][6] == "1")?"G_Con_TD_Dark":"G_Con_TD_Ball";
		document.all["OddsTD"+intNum].className = (arrTmpGame[i][6] == "1")?"G_Con_TD_Dark":"G_Con_TD_Odds";
		if(isGetSuppleOdds == "Y")document.all["OddsTD"+intNum].className = (arrTmpGame[i][6] == "1")?"G_Con_TD_Dark_Y":"G_Con_TD_Light_Y";
		if(isSpecial == 1 || isSpecial > 20){
			if(minPayOff > intTmp2)minPayOff = intTmp2;
		}else{
			arrN = ValueSort(arrN, intTmp2, intNum, "");
		}
		strClass = (preWin2 > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";
		strCon += "<br /><a class=\""+strClass+"\">"+Math.round(preWin2).toString()+"</a>";

		strClass = (preWin > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";
		strCon += "<a class=\"G_Con_Odds_NoLink\" href=\"JavaScript:void(0)\">&nbsp;/&nbsp;</a><a class=\""+strClass+"\">"+Math.round(preWin).toString()+"</a>";
		if(preWin < intBalance){	//補貨計算
			strCon += "<br /><a class=\"G_Con_Balance\">"+strBalanceText+Math.floor((intBalance - preWin)/flOdds).toString()+"</a>";
		}
		if(isSpecial == 1 || isSpecial > 20)arrN = ValueSort(arrN, preWin*intSortPlus, intNum, strCon);
		document.all["OddsTD"+intNum].innerHTML = strCon;
	}
	document.all.SumStakeValue.innerHTML = Math.round(sumSuppleStake);
	if(isSpecial == 1 || isSpecial > 20){
		document.all.MaxLose.innerHTML = Math.round(minPayOff + sumSuppleCommission - sumSuppleStake);
		for(var i = 0; i < arrSpecialNum.length; i++){
			intNum = arrSpecialNum[i];
			//document.all["Sort"+(i+1)].innerHTML = "<a href=\"JavaScript:intSortSite=1;ShowOddsLayer("+arrTmpGame[intNum][1]+", "+intBT+", "+intNum+", "+arrTmpGame[intNum][5]+", "+arrTmpGame[intNum][4]+","+Math.floor(parseFloat(arrTmpGame[intNum][8]) - parseFloat(arrTmpGame[intNum][12]))+",0)\" class=\"G_Con_Numer_"+BColor_Value[BColor_Index[intNum-1]]+"\">" + ((intNum < 10)?"0"+intNum:intNum) + "</a>";
			arrSpecialCon[i] = arrSpecialCon[i].replace("intSortSite=0", "intSortSite="+(i+1));
			arrSpecialCon[i] = arrSpecialCon[i].replace("intSortSite=0", "intSortSite="+(i+1));
			document.all["Sort"+(i+1)].innerHTML = document.all["Num"+intNum].innerHTML;
			document.all["Sort"+(i+1)].innerHTML = document.all["Sort"+(i+1)].innerHTML.replace("intSortSite=0", "intSortSite="+(i+1));
			document.all["Sort"+(i+1)].innerHTML = document.all["Sort"+(i+1)].innerHTML.replace("NumLink", "SortNumLink");
			document.all["SortTD"+(i+1)].innerHTML = arrSpecialCon[i];
			document.all["Sort"+(i+1)].className = document.all["Num"+intNum].className+"_Sort";
			document.all["SortTD"+(i+1)].className = document.all["OddsTD"+intNum].className+"_Sort";
		}
	}else{
		for(i = 0; i < arrN.length; i++)minPayOff += arrN[i];
		document.all.MaxLose.innerHTML = Math.round(minPayOff + sumSuppleCommission - sumSuppleStake);
	}
	if(isSpecial > 20)return;
	//單雙
	if (isSpecial == 1) {
		arrTmpGame	= Game2;
		intBT = 2;
	} else {
		arrTmpGame 	= Game5;
		intBT = 5;
	}
	for(var i = 0; i < arrTmpGame.length; i++){
		intNum = eval(arrTmpGame[i][3]);
		if(intNum == "0"){
			strTD = "OddOddsTD";
			strTip = "OddTip";
		}else{
			strTD = "EvenOddsTD";
			strTip = "EvenTip";
		}
		document.all[strTip+"Link"].href = "JavaScript:ShowOddsLayer("+arrTmpGame[i][1]+", "+intBT+", "+intNum+", "+Math.round((1+parseFloat(arrTmpGame[i][5]))*1000)/1000+", "+arrTmpGame[i][4]+","+Math.floor(parseFloat(arrTmpGame[i][8]) - parseFloat(arrTmpGame[i][12]))+",0)";
		document.getElementById(strTD).innerHTML = "<a class=\"G_Con_Odds_NoLink\" href=\"JavaScript:ShowOddsLayer("+arrTmpGame[i][1]+", "+intBT+", "+intNum+", "+(1+parseFloat(arrTmpGame[i][5]))+", "+arrTmpGame[i][4]+","+Math.floor(parseFloat(arrTmpGame[i][8]) - parseFloat(arrTmpGame[i][12]))+",0)\">"+Math.round((1+parseFloat(arrTmpGame[i][5]))*1000)/1000+"</a><br /><a class=\"G_Con_Bet\" href=\"JavaScript:getWagerData("+arrTmpGame[i][1]+","+arrTmpGame[i][2]+","+intNum+",0)\">"+arrTmpGame[i][11]+"/"+Math.round(parseFloat(arrTmpGame[i][12])).toString()+"</a>";

		intTmp2 = parseFloat(arrTmpGame[i][13]) + parseFloat(arrTmpGame[i][12]);
		preWin2 = intTmp2 - sumSuppleOEStake + sumSuppleOECommission; //派彩所得 - 總下注金額 + 所有退水
		strClass = (preWin2 > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";
		document.getElementById(strTD).innerHTML += "<br /><a class=\""+strClass+"\">"+Math.round(preWin2).toString()+"</a>";

		intTmp = parseFloat(arrTmpGame[i][9]) + parseFloat(arrTmpGame[i][8]);
		preWin = sumOEStake - intTmp - sumOECommission;
		strClass = (preWin > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";
		document.getElementById(strTD).innerHTML += "<a class=\"G_Con_Odds_NoLink\" href=\"JavaScript:void(0)\">&nbsp;/&nbsp;</a><a class=\""+strClass+"\">"+Math.round(preWin).toString()+"</a>";

		document.getElementById(strTD).className = (arrTmpGame[i][6] == "1")?"G_Con_TD_Dark":"";
		document.all[strTip].className = (arrTmpGame[i][6] == "1")?"G_Con_TD_Dark":"G_Con_TD_Ball";
		if(isGetSuppleOdds == "Y")document.getElementById(strTD).className = (arrTmpGame[i][6] == "1")?"G_Con_TD_Dark_Y":"G_Con_TD_Light_Y";
	}

	//大小
	if (isSpecial == 1) {
		arrTmpGame	= Game3;
		intBT = 3;
	} else {
		arrTmpGame 	= Game6;
		intBT = 6;
	}
	for(var i = 0; i < arrTmpGame.length; i++){
		intNum = eval(arrTmpGame[i][3]);
		if(intNum == "0"){
			strTD = "OverOddsTD";
			strTip = "OverTip";
		}else{
			strTD = "UnderOddsTD";
			strTip = "UnderTip";
		}
		document.all[strTip+"Link"].href = "JavaScript:ShowOddsLayer("+arrTmpGame[i][1]+", "+intBT+", "+intNum+", "+Math.round((1+parseFloat(arrTmpGame[i][5]))*1000)/1000+", "+arrTmpGame[i][4]+","+Math.floor(parseFloat(arrTmpGame[i][8]) - parseFloat(arrTmpGame[i][12]))+",0)";
		document.getElementById(strTD).innerHTML = "<a class=\"G_Con_Odds_NoLink\" href=\"JavaScript:ShowOddsLayer("+arrTmpGame[i][1]+", "+intBT+", "+intNum+", "+(1+parseFloat(arrTmpGame[i][5]))+", "+arrTmpGame[i][4]+","+Math.floor(parseFloat(arrTmpGame[i][8]) - parseFloat(arrTmpGame[i][12]))+",0)\">"+Math.round((1+parseFloat(arrTmpGame[i][5]))*1000)/1000+"</a><br /><a class=\"G_Con_Bet\" href=\"JavaScript:getWagerData("+arrTmpGame[i][1]+","+arrTmpGame[i][2]+","+intNum+",0)\">"+arrTmpGame[i][11]+"/"+Math.round(parseFloat(arrTmpGame[i][12])).toString()+"</a>";

		intTmp2 = parseFloat(arrTmpGame[i][13]) + parseFloat(arrTmpGame[i][12]);
		preWin2 = intTmp2 - sumSuppleOUStake + sumSuppleOUCommission; //派彩所得 - 總下注金額 + 所有退水
		strClass = (preWin2 > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";
		document.getElementById(strTD).innerHTML += "<br /><a class=\""+strClass+"\">"+Math.round(preWin2).toString()+"</a>";

		intTmp = parseFloat(arrTmpGame[i][9]) + parseFloat(arrTmpGame[i][8]);
		preWin = sumOUStake - intTmp - sumOUCommission;
		strClass = (preWin > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";
		document.getElementById(strTD).innerHTML += "<a class=\"G_Con_Odds_NoLink\" href=\"JavaScript:void(0)\">&nbsp;/&nbsp;</a><a class=\""+strClass+"\">"+Math.round(preWin).toString()+"</a>";

		document.getElementById(strTD).className = (arrTmpGame[i][6] == "1")?"G_Con_TD_Dark":"";
		document.all[strTip].className = (arrTmpGame[i][6] == "1")?"G_Con_TD_Dark":"G_Con_TD_Ball";
		if(isGetSuppleOdds == "Y")document.getElementById(strTD).className = (arrTmpGame[i][6] == "1")?"G_Con_TD_Dark_Y":"G_Con_TD_Light_Y";
	}

	//合數單雙
	if (isSpecial == 1) {
		arrTmpGame	= Game16;
		intBT = 16;
	} else {
		return;
	}
	for(var i = 0; i < arrTmpGame.length; i++){
		intNum = eval(arrTmpGame[i][3]);
		if(intNum == "0"){
			strTD = "SumOddOddsTD";
			strTip = "SumOddTip";
		}else{
			strTD = "SumEvenOddsTD";
			strTip = "SumEvenTip";
		}
		document.all[strTip+"Link"].href = "JavaScript:ShowOddsLayer("+arrTmpGame[i][1]+", "+intBT+", "+intNum+", "+Math.round((1+parseFloat(arrTmpGame[i][5]))*1000)/1000+", "+arrTmpGame[i][4]+","+Math.floor(parseFloat(arrTmpGame[i][8]) - parseFloat(arrTmpGame[i][12]))+",0)";
		document.getElementById(strTD).innerHTML = "<a class=\"G_Con_Odds_NoLink\" href=\"JavaScript:ShowOddsLayer("+arrTmpGame[i][1]+", "+intBT+", "+intNum+", "+(1+parseFloat(arrTmpGame[i][5]))+", "+arrTmpGame[i][4]+","+Math.floor(parseFloat(arrTmpGame[i][8]) - parseFloat(arrTmpGame[i][12]))+",0)\">"+Math.round((1+parseFloat(arrTmpGame[i][5]))*1000)/1000+"</a><br /><a class=\"G_Con_Bet\" href=\"JavaScript:getWagerData("+arrTmpGame[i][1]+","+arrTmpGame[i][2]+","+intNum+",0)\">"+arrTmpGame[i][11]+"/"+Math.round(parseFloat(arrTmpGame[i][12])).toString()+"</a>";

		intTmp2 = parseFloat(arrTmpGame[i][13]) + parseFloat(arrTmpGame[i][12]);
		preWin2 = intTmp2 - sumSuppleSOEStake + sumSuppleSOECommission; //派彩所得 - 總下注金額 + 所有退水
		strClass = (preWin2 > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";
		document.getElementById(strTD).innerHTML += "<br /><a class=\""+strClass+"\">"+Math.round(preWin2).toString()+"</a>";

		intTmp = parseFloat(arrTmpGame[i][9]) + parseFloat(arrTmpGame[i][8]);
		preWin = sumSOEStake - intTmp - sumSOECommission;
		strClass = (preWin > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";
		document.getElementById(strTD).innerHTML += "<a class=\"G_Con_Odds_NoLink\" href=\"JavaScript:void(0)\">&nbsp;/&nbsp;</a><a class=\""+strClass+"\">"+Math.round(preWin).toString()+"</a>";

		document.getElementById(strTD).className = (arrTmpGame[i][6] == "1")?"G_Con_TD_Dark":"";
		document.all[strTip].className = (arrTmpGame[i][6] == "1")?"G_Con_TD_Dark":"G_Con_TD_Ball";
		if(isGetSuppleOdds == "Y")document.getElementById(strTD).className = (arrTmpGame[i][6] == "1")?"G_Con_TD_Dark_Y":"G_Con_TD_Light_Y";
	}
}

function ChangeType(intBT, intNum){
	switch(intBT){
		case 1:
		case 4:
		case 21:
		case 22:
		case 23:
		case 24:
		case 25:
		case 26:
		case 28:
			return (intNum < 10)?"0"+intNum.toString():intNum.toString();
			break;

		case 2:
		case 5:
		case 12:
		case 27:
			return (intNum % 10 == 0)?"<?php print $_strSame_String[Odd];//單?>":"<?php print $_strSame_String[Even];//雙?>";
			break;

		case 3:
		case 6:
		case 13:
			return (intNum %10 == 0)?"<?php print $_strSame_String[Over];//大?>":"<?php print $_strSame_String[Under];//小?>";
			break;

		case 7:
		case 8:
		case 9:
		case 10:
		case 11:
			return intNum;
			break;

		case 16:
			return (intNum %10 == 0)?"<?php print $_strSame_String[SOdd];//合單?>":"<?php print $_strSame_String[SEven];//合雙?>";
			break;

		case 14:
		case 17:
			if(intNum % 10 == 0)return "<?php print $_strSame_String[Color0];//紅波?>";
			if(intNum % 10 == 1)return "<?php print $_strSame_String[Color1];//藍波?>";
			if(intNum % 10 == 2)return "<?php print $_strSame_String[Color2];//綠波?>";
			break;

		case 18:
		case 19:
			return arrAnimals[intNum];
			break;
		
		case 20:
			return intNum + "&nbsp;<?php print $_strSame_String[Mantissa];//尾?>";
			break;

		case 29:
			return arrHelfColor[intNum];
			break;
	}
}

//特碼生肖色波 初始化
function iniAnimalsColor(){
	for(var i = 1; i <= 12; i++)strLayer1718 = strLayer1718.replace("{AnimalsNumber"+i+"}", eval("strAnimals"+i));
	document.all["ListStatus"].innerHTML = strT17;
	document.all["BetList"].innerHTML = strLayer1718;
	//document.all["GameTime"].innerHTML = strGameTime;
	//document.all["GameNo"].innerHTML = strGameNo;
	GetOdds();
}

//一般生肖尾數 初始化
function iniAnimalsMantissa(){
	for(var i = 1; i <= 12; i++)strLayer1920 = strLayer1920.replace("{AnimalsNumber"+i+"}", eval("strAnimals"+i));
	document.all["ListStatus"].innerHTML = strT19;
	document.all["BetList"].innerHTML = strLayer1920;
	//document.all["GameTime"].innerHTML = strGameTime;
	//document.all["GameNo"].innerHTML = strGameNo;
	GetOdds();
}

//特半波 初始化
function iniHelfColor(){
	document.all["ListStatus"].innerHTML = strT29;
	document.all["BetList"].innerHTML = strLayer29;
	//document.all["GameTime"].innerHTML = strGameTime;
	//document.all["GameNo"].innerHTML = strGameNo;
	GetOdds();
}

//顯示特半波賠率表
function ShowHelfColorOdds(){
	var k, arrTmpGame = new Array(), objTD, intTmp = 0, preWin = 0, intTmp2 = 0, preWin2 = 0, strClass = "", intN;
	//特碼生肖
	arrTmpGame = Game29;
	for(k = 0; k <= 11; k++){
		intN = Math.floor((k % 4) / 2);
		objTD = document.all["OddsTD29_"+k.toString()];
		objTD.innerHTML = "<a class=\"G_Con_Odds\" href=\"JavaScript:ShowOddsLayer("+arrTmpGame[k][1]+","+arrTmpGame[k][2]+","+k.toString()+","+arrTmpGame[k][5]+", "+arrTmpGame[k][4]+","+Math.floor(parseFloat(arrTmpGame[k][8]) - parseFloat(arrTmpGame[k][12]))+",0)\">"+arrTmpGame[k][5]+"</a><br /><a class=\"G_Con_Bet\" href=\"JavaScript: getWagerData("+arrTmpGame[k][1]+","+arrTmpGame[k][2]+","+k.toString()+",0)\">"+arrTmpGame[k][11]+"/"+Math.round(parseFloat(arrTmpGame[k][12])).toString()+"</a>";

		intTmp2 = parseFloat(arrTmpGame[k][13]) + parseFloat(arrTmpGame[k][12]);
		preWin2 = intTmp2 - arrSuppleHelfColorStake[intN] + arrSuppleHelfColorCommission[intN];
		strClass = (preWin2 > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";
		objTD.innerHTML += "<br /><a class=\""+strClass+"\">"+Math.round(preWin2).toString()+"</a>";
		
		intTmp = parseFloat(arrTmpGame[k][9]) + parseFloat(arrTmpGame[k][8]);
		preWin = arrHelfColorStake[intN] - intTmp - arrHelfColorCommission[intN];
		strClass = (preWin > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";
		objTD.innerHTML += "<a class=\"G_Con_Odds_NoLink\" href=\"JavaScript:void(0)\">&nbsp;/&nbsp;</a><a class=\""+strClass+"\">"+Math.round(preWin).toString()+"</a>";

		objTD.className = (arrTmpGame[k][6] == "1")?"G_Con_TD_Dark":"";
		if(isGetSuppleOdds == "Y")objTD.className = (arrTmpGame[k][6] == "1")?"G_Con_TD_Dark_Y":"G_Con_TD_Light_Y";
	}
}

//顯示生肖色波賠率表
function ShowAnimalsColorOdds(){
	var k, arrTmpGame = new Array(), objTD, intTmp = 0, preWin = 0, intTmp2 = 0, preWin2 = 0, strClass = "";
	//特碼生肖
	arrTmpGame = Game18;
	for(k = 1; k <= 12; k++){
		//alert("OddsTD18_"+k.toString());
		objTD = document.all["OddsTD18_"+k.toString()];
		objTD.innerHTML = "<a class=\"G_Con_Odds\" href=\"JavaScript:ShowOddsLayer("+arrTmpGame[k][1]+","+arrTmpGame[k][2]+","+k.toString()+","+arrTmpGame[k][5]+", "+arrTmpGame[k][4]+","+Math.floor(parseFloat(arrTmpGame[k][8]) - parseFloat(arrTmpGame[k][12]))+",0)\">"+arrTmpGame[k][5]+"</a><br /><a class=\"G_Con_Bet\" href=\"JavaScript: getWagerData("+arrTmpGame[k][1]+","+arrTmpGame[k][2]+","+k.toString()+",0)\">"+arrTmpGame[k][11]+"/"+Math.round(parseFloat(arrTmpGame[k][12])).toString()+"</a>";

		intTmp2 = parseFloat(arrTmpGame[k][13]) + parseFloat(arrTmpGame[k][12]);
		preWin2 = intTmp2 - sumSuppleAnimalsStake + sumSuppleAnimalsCommission;
		strClass = (preWin2 > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";
		objTD.innerHTML += "<br /><a class=\""+strClass+"\">"+Math.round(preWin2).toString()+"</a>";
		
		intTmp = parseFloat(arrTmpGame[k][9]) + parseFloat(arrTmpGame[k][8]);
		preWin = sumAnimalsStake - intTmp - sumAnimalsCommission;
		strClass = (preWin > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";
		objTD.innerHTML += "<a class=\"G_Con_Odds_NoLink\" href=\"JavaScript:void(0)\">&nbsp;/&nbsp;</a><a class=\""+strClass+"\">"+Math.round(preWin).toString()+"</a>";

		objTD.className = (arrTmpGame[k][6] == "1")?"G_Con_TD_Dark":"";
		if(isGetSuppleOdds == "Y")objTD.className = (arrTmpGame[k][6] == "1")?"G_Con_TD_Dark_Y":"G_Con_TD_Light_Y";
	}
	//特碼色波
	arrTmpGame = Game17;
	for(k = 0; k <= 2; k++){

		objTD = document.all["OddsTD17_"+k.toString()];
		objTD.innerHTML = "<a class=\"G_Con_Odds\" href=\"JavaScript:ShowOddsLayer("+arrTmpGame[k][1]+","+arrTmpGame[k][2]+","+k.toString()+","+arrTmpGame[k][5]+", "+arrTmpGame[k][4]+","+Math.floor(parseFloat(arrTmpGame[k][8]) - parseFloat(arrTmpGame[k][12]))+",0)\">"+arrTmpGame[k][5]+"</a><br /><a class=\"G_Con_Bet\" href=\"JavaScript: getWagerData("+arrTmpGame[k][1]+","+arrTmpGame[k][2]+","+k.toString()+",0)\">"+arrTmpGame[k][11]+"/"+Math.round(parseFloat(arrTmpGame[k][12])).toString()+"</a>";

		intTmp2 = parseFloat(arrTmpGame[k][13]) + parseFloat(arrTmpGame[k][12]);
		preWin2 = intTmp2 - sumSuppleColorStake + sumSuppleColorCommission;
		strClass = (preWin2 > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";
		objTD.innerHTML += "<br /><a class=\""+strClass+"\">"+Math.round(preWin2).toString()+"</a>";		

		intTmp = parseFloat(arrTmpGame[k][9]) + parseFloat(arrTmpGame[k][8]);
		preWin = sumColorStake - intTmp - sumColorCommission;
		strClass = (preWin > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";
		objTD.innerHTML += "<a class=\"G_Con_Odds_NoLink\" href=\"JavaScript:void(0)\">&nbsp;/&nbsp;</a><a class=\""+strClass+"\">"+Math.round(preWin).toString()+"</a>";

		objTD.className = (arrTmpGame[k][6] == "1")?"G_Con_TD_Dark":"";
		if(isGetSuppleOdds == "Y")objTD.className = (arrTmpGame[k][6] == "1")?"G_Con_TD_Dark_Y":"G_Con_TD_Light_Y";
	}
}

//顯示一般生肖尾數賠率表
function ShowAnimalsMantissaOdds(){
	var k, arrTmpGame = new Array(), objTD, intTmp = 0, preWin = 0, intTmp2 = 0, preWin2 = 0, strClass = "";
	//一般生肖
	arrTmpGame = Game19;
	for(k = 1; k <= 12; k++){
		objTD = document.all["OddsTD19_"+k.toString()];
		objTD.innerHTML = "<a class=\"G_Con_Odds\" href=\"JavaScript:ShowOddsLayer("+arrTmpGame[k][1]+","+arrTmpGame[k][2]+","+k.toString()+","+arrTmpGame[k][5]+", "+arrTmpGame[k][4]+","+Math.floor(parseFloat(arrTmpGame[k][8]) - parseFloat(arrTmpGame[k][12]))+",0)\">"+arrTmpGame[k][5]+"</a><br /><a class=\"G_Con_Bet\" href=\"JavaScript: getWagerData("+arrTmpGame[k][1]+","+arrTmpGame[k][2]+","+k.toString()+",0)\">"+arrTmpGame[k][11]+"/"+Math.round(parseFloat(arrTmpGame[k][12])).toString()+"</a>";

		intTmp2 = parseFloat(arrTmpGame[k][13]) + parseFloat(arrTmpGame[k][12]);
		preWin2 = intTmp2 - sumSuppleAnimalsStake + sumSuppleAnimalsCommission;
		strClass = (preWin2 > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";
		objTD.innerHTML += "<br /><a class=\""+strClass+"\">"+Math.round(preWin2).toString()+"</a>";
		
		intTmp = parseFloat(arrTmpGame[k][9]) + parseFloat(arrTmpGame[k][8]);
		preWin = sumAnimalsStake - intTmp - sumAnimalsCommission;
		strClass = (preWin > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";
		objTD.innerHTML += "<a class=\"G_Con_Odds_NoLink\" href=\"JavaScript:void(0)\">&nbsp;/&nbsp;</a><a class=\""+strClass+"\">"+Math.round(preWin).toString()+"</a>";

		objTD.className = (arrTmpGame[k][6] == "1")?"G_Con_TD_Dark":"";
		if(isGetSuppleOdds == "Y")objTD.className = (arrTmpGame[k][6] == "1")?"G_Con_TD_Dark_Y":"G_Con_TD_Light_Y";
	}
	//一般尾數
	arrTmpGame = Game20;
	for(k = 0; k <= 9; k++){

		objTD = document.all["OddsTD20_"+k.toString()];
		objTD.innerHTML = "<a class=\"G_Con_Odds\" href=\"JavaScript:ShowOddsLayer("+arrTmpGame[k][1]+","+arrTmpGame[k][2]+","+k.toString()+","+arrTmpGame[k][5]+", "+arrTmpGame[k][4]+","+Math.floor(parseFloat(arrTmpGame[k][8]) - parseFloat(arrTmpGame[k][12]))+",0)\">"+arrTmpGame[k][5]+"</a><br /><a class=\"G_Con_Bet\" href=\"JavaScript: getWagerData("+arrTmpGame[k][1]+","+arrTmpGame[k][2]+","+k.toString()+",0)\">"+arrTmpGame[k][11]+"/"+Math.round(parseFloat(arrTmpGame[k][12])).toString()+"</a>";

		intTmp2 = parseFloat(arrTmpGame[k][13]) + parseFloat(arrTmpGame[k][12]);
		preWin2 = intTmp2 - sumSuppleColorStake + sumSuppleColorCommission;
		strClass = (preWin2 > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";
		objTD.innerHTML += "<br /><a class=\""+strClass+"\">"+Math.round(preWin2).toString()+"</a>";		

		intTmp = parseFloat(arrTmpGame[k][9]) + parseFloat(arrTmpGame[k][8]);
		preWin = sumColorStake - intTmp - sumColorCommission;
		strClass = (preWin > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";
		objTD.innerHTML += "<a class=\"G_Con_Odds_NoLink\" href=\"JavaScript:void(0)\">&nbsp;/&nbsp;</a><a class=\""+strClass+"\">"+Math.round(preWin).toString()+"</a>";

		objTD.className = (arrTmpGame[k][6] == "1")?"G_Con_TD_Dark":"";
		if(isGetSuppleOdds == "Y")objTD.className = (arrTmpGame[k][6] == "1")?"G_Con_TD_Dark_Y":"G_Con_TD_Light_Y";
	}
}

//正碼 1-6 初始化
function iniNormalNumber1_6(isParlays){
	if(isParlays == 1){
		document.all["ListStatus"].innerHTML = strT15;
		document.all["BetList"].innerHTML = strLayer15;
	}else{
		document.all["ListStatus"].innerHTML = strT12;
		document.all["BetList"].innerHTML = strLayer121314;
	}
	GetOdds();
}

//顯示正碼 1-6 及過關賠率表
function ShowNormalNumber1_6Odds(isParlays){
	var i, j, k, m, arrBT = new Array(12,13,14,27), arrTmpGame = new Array(), objTD, intID, intMax, intTmp = 0, preWin = 0, intTmp2 = 0, preWin2 = 0, strClass = "", cost = 0;
	for(m = 0; m < arrBT.length; m++){
		i = arrBT[m];
		arrTmpGame = eval("Game" + i);
		intMax = (i == 14)?2:1;
		cost = (i == 14)?0:1;
		for(j = 1; j <= 6; j++){
			if(i == 12){
				preWin = arrOE16Stake[j] - arrOE16Commission[j];
				preWin2 = arrSuppleOE16Stake[j] - arrSuppleOE16Commission[j];
			}else if(i == 13){
				preWin = arrOU16Stake[j] - arrOU16Commission[j];
				preWin2 = arrSuppleOU16Stake[j] - arrSuppleOU16Commission[j];
			}else if(i == 14){
				preWin = arrColor16Stake[j] - arrColor16Commission[j];
				preWin2 = arrSuppleColor16Stake[j] - arrSuppleColor16Commission[j];
			}else if(i == 27){
				preWin = arrSOU16Stake[j] - arrSOU16Commission[j];
				preWin2 = arrSuppleSOU16Stake[j] - arrSuppleSOU16Commission[j];
			}
			for(k = 0; k <= intMax; k++){
				intID = j*10 + k;
				objTD = document.all["OddsTD"+i.toString()+"_"+intID.toString()];
				if(isParlays == 1){
					objTD.innerHTML = "<a class=\"G_Con_Odds\">"+arrTmpGame[intID][5]+"</a><br /><a class=\"G_Con_Bet\" href=\"JavaScript: getWagerData("+arrTmpGame[intID][1]+","+arrTmpGame[intID][2]+","+intID.toString()+",0)\">"+arrTmpGame[intID][11]+"/"+Math.round(parseFloat(arrTmpGame[intID][12])).toString()+"</a>";
				}else{

					objTD.innerHTML = "<a class=\"G_Con_Odds\" href=\"JavaScript:ShowOddsLayer("+arrTmpGame[intID][1]+","+arrTmpGame[intID][2]+","+intID.toString()+","+(cost+parseFloat(arrTmpGame[intID][5]))+", "+arrTmpGame[intID][4]+","+Math.floor(parseFloat(arrTmpGame[intID][8]) - parseFloat(arrTmpGame[intID][12]))+",0)\">"+Math.round((cost+parseFloat(arrTmpGame[intID][5]))*100)/100+"</a><br /><a class=\"G_Con_Bet\" href=\"JavaScript: getWagerData("+arrTmpGame[intID][1]+","+arrTmpGame[intID][2]+","+intID.toString()+",0)\">"+arrTmpGame[intID][11]+"/"+Math.round(parseFloat(arrTmpGame[intID][12])).toString()+"</a>";

					intTmp2 = parseFloat(arrTmpGame[intID][13]) + parseFloat(arrTmpGame[intID][12]);
					strClass = ((intTmp2 - preWin2) > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";
					objTD.innerHTML += "<br /><a class=\""+strClass+"\">"+Math.round(intTmp2 - preWin2).toString()+"</a>";
					
					intTmp = parseFloat(arrTmpGame[intID][9]) + parseFloat(arrTmpGame[intID][8]);
					strClass = ((preWin - intTmp) > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";
					objTD.innerHTML += "<a class=\"G_Con_Odds_NoLink\" href=\"JavaScript:void(0)\">&nbsp;/&nbsp;</a><a class=\""+strClass+"\">"+Math.round(preWin - intTmp).toString()+"</a>";
				}
				objTD.className = (arrTmpGame[intID][6] == "1")?"G_Con_TD_Dark":"";
				if(isGetSuppleOdds == "Y")objTD.className = (arrTmpGame[intID][6] == "1")?"G_Con_TD_Dark_Y":"G_Con_TD_Light_Y";
			}
		}
	}
}

//連碼初始化
function iniJoinNumber(){
	document.all["ListStatus"].innerHTML = strT7;
	document.all["BetList"].innerHTML = strLayer0711;
	//document.all["GameTime"].innerHTML = strGameTime;
	//document.all["GameNo"].innerHTML = strGameNo;
	GetOdds();
}

//顯示 五不中
function ShowFiveNotWinNumber(){
	var intNum = 0, strTD = "", strTip = "", arrTmpGame = new Array(), sumOdds = 0, maxPayOff = 0, intTmp = 0, OverBetOn, OverBet, OverBetColor, intBT, preWin = 0, intTmp2 = 0, preWin2 = 0, strClass = "", strCon = "", flOdds = 0, flComm, intSumStake = 0;// sumPayOff = 0,
	var intBT = 31;
	var strTDSite = "";

	arrTmpGame = eval("Game" + intBT.toString());
	for(var intNum = 1; intNum <= 49; intNum++){
		strTDSite = intNum.toString();
		//document.getElementById("OddsTD"+strTDSite).innerHTML

		strCon = "<a class=\"G_Con_Odds\" href=\"JavaScript:ShowOddsLayer("+arrTmpGame[intNum][1]+","+arrTmpGame[intNum][2]+","+intNum.toString()+","+arrTmpGame[intNum][5]+", "+arrTmpGame[intNum][4]+","+Math.floor(parseFloat(arrSumStake[intBT]) - parseFloat(arrSumSuppleStake[intBT]))+",0)\">"+arrTmpGame[intNum][5]+"</a><br />";
		strCon += "<a class=\"G_Con_Bet\" href=\"JavaScript: getWagerData("+arrTmpGame[intNum][1]+","+arrTmpGame[intNum][2]+","+intNum+",0,"+intNum+")\">"+Math.round(parseFloat(arrTmpGame[intNum][11])).toString()+"/"+Math.round(parseFloat(arrTmpGame[intNum][12])).toString()+"</a>";

		intTmp2 = parseFloat(arrTmpGame[intNum][13]) + parseFloat(arrTmpGame[intNum][12]);
		preWin2 = intTmp2 - arrSumSuppleStake[intBT] + arrSumSuppleCommission[intBT];
		strClass = (preWin2 > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";
		//strCon += "<br /><a class=\""+strClass+"\">"+Math.round(preWin2).toString()+"</a>";

		intTmp = parseFloat(arrTmpGame[intNum][9]) + parseFloat(arrTmpGame[intNum][8]);
		preWin = arrSumStake[intBT] - intTmp - arrSumCommission[intBT];
		strClass = (preWin > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";
		//strCon += "<a class=\"G_Con_Odds_NoLink\" href=\"JavaScript:void(0)\">&nbsp;/&nbsp;</a><a class=\""+strClass+"\">"+Math.round(preWin).toString()+"</a>";
		document.getElementById("OddsTD"+strTDSite).innerHTML = strCon;

		document.getElementById("Num"+strTDSite).className = (arrTmpGame[intNum][6] == "1")?"G_Con_TD_Dark":"G_Con_TD_Ball";
		document.getElementById("OddsTD"+strTDSite).className = (arrTmpGame[intNum][6] == "1")?"G_Con_TD_Dark":"G_Con_TD_Odds";

		intSumStake += parseFloat(arrTmpGame[intNum][8]);
	}
	document.getElementById("SumStakeValue").innerHTML = Math.round(arrSumSuppleStake[intBT]);
}


//生肖連 尾數連 初始化
function iniBT3243Numer(intBT){
	document.getElementById("ListStatus").innerHTML = (intBT == 32)?strT32:strT38;
	document.getElementById("BetList").innerHTML = (intBT == 32)?strLayer3237:strLayer3843;
	GetOdds();
}

//顯示 生肖連 尾數連 數字賠率
function ShowBT3243Number(intBT){
	var intNum = 0, strTD = "", strTip = "", arrTmpGame = new Array(), sumOdds = 0, maxPayOff = 0, intTmp = 0, OverBetOn, OverBet, OverBetColor, intBT, preWin = 0, strClass = "", strCon = "", flOdds = 0, flComm, intSumStake = 0;// sumPayOff = 0,
	if(intBT == 32){
		var arrBT = new Array(32, 33, 34, 35, 36, 37);
		var arrBTMinNum = new Array(1, 1, 1, 1, 1, 1);
		var arrBTMaxNum = new Array(12, 12, 12, 12, 12, 12);
	}else{
		var arrBT = new Array(38, 39, 40, 41, 42, 43);
		var arrBTMinNum = new Array(0, 0, 0, 0, 0, 0);
		var arrBTMaxNum = new Array(9, 9, 9, 9, 9, 9);
	}
	var strTDSite = "";

	for(var i = 0; i < arrBT.length; i++){
		intBT = arrBT[i];
		arrTmpGame = eval("Game" + intBT.toString());
		intSumStake = 0;

		for(var intNum = arrBTMinNum[i]; intNum <= arrBTMaxNum[i]; intNum++){
			strTDSite = intBT.toString() + "_" + intNum.toString();
			//document.getElementById("OddsTD"+strTDSite).innerHTML

			strCon = "<a class=\"G_Con_Odds\" href=\"JavaScript:ShowOddsLayer("+arrTmpGame[intNum][1]+","+arrTmpGame[intNum][2]+","+intNum.toString()+","+arrTmpGame[intNum][5]+", "+arrTmpGame[intNum][4]+","+Math.floor(parseFloat(arrSumStake[intBT]) - parseFloat(arrSumSuppleStake[intBT]))+",0)\">"+arrTmpGame[intNum][5]+"</a><br />";
			strCon += "<a class=\"G_Con_Bet\" href=\"JavaScript: intSortSite=0;getWagerData("+arrTmpGame[intNum][1]+","+arrTmpGame[intNum][2]+","+intNum+",0,"+intNum+")\">"+Math.round(parseFloat(arrTmpGame[intNum][11])).toString()+"/"+Math.round(parseFloat(arrTmpGame[intNum][12])).toString()+"</a>";

			intTmp2 = parseFloat(arrTmpGame[intNum][13]) + parseFloat(arrTmpGame[intNum][12]);
			preWin2 = intTmp2 - arrSumSuppleStake[intBT] + arrSumSuppleCommission[intBT];
			strClass = (preWin2 > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";
			//strCon += "<br /><a class=\""+strClass+"\">"+Math.round(preWin2).toString()+"</a>";

			intTmp = parseFloat(arrTmpGame[intNum][9]) + parseFloat(arrTmpGame[intNum][8]);
			preWin = arrSumStake[intBT] - intTmp - arrSumCommission[intBT];
			strClass = (preWin > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";
			//strCon += "<a class=\"G_Con_Odds_NoLink\" href=\"JavaScript:void(0)\">&nbsp;/&nbsp;</a><a class=\""+strClass+"\">"+Math.round(preWin).toString()+"</a>";
			document.getElementById("OddsTD"+strTDSite).innerHTML = strCon;

			document.getElementById("Num"+strTDSite).className = (arrTmpGame[intNum][6] == "1")?"G_Con_TD_Dark":"G_Con_TD_Ball";
			document.getElementById("OddsTD"+strTDSite).className = (arrTmpGame[intNum][6] == "1")?"G_Con_TD_Dark":"G_Con_TD_Odds";

			intSumStake += parseFloat(arrTmpGame[intNum][8]);
		}

		document.getElementById("SumWagerTD"+intBT.toString()).innerHTML = Math.round(arrSumSuppleStake[intBT]);
	}	//for(var i = 0; i < arrBT.length; i++)
}

//顯示連碼賠率表
function ShowJoinNumberOdds(){
	var i, j, arrTmpGame = new Array(), arrDSort = new Array();
	if(isGetSuppleOdds == "Y")document.all.BalanceOdds.disabled = true;
	for(i = 7; i <= 11; i++){
		arrTmpGame = eval("Game" + i);
		if(arrTmpGame.length > 1){
			document.all["OddsTD"+i+"_1"].innerHTML = ""+arrTmpGame[1][5]+"";
			document.all["OddsTD"+i+"_1"].className = (arrTmpGame[0][6] == "1")?"G_Con_TD_Dark":"";
			if(isGetSuppleOdds == "Y")document.all["OddsTD"+i+"_1"].className = (arrTmpGame[0][6] == "1")?"G_Con_TD_Dark_Y":"G_Con_TD_Light_Y";
		}
		document.all["OddsTD"+i+"_0"].innerHTML = ""+arrTmpGame[0][5]+"";
		document.all["OddsTD"+i+"_0"].className = (arrTmpGame[0][6] == "1")?"G_Con_TD_Dark":"";
		if(isGetSuppleOdds == "Y")document.all["OddsTD"+i+"_0"].className = (arrTmpGame[0][6] == "1")?"G_Con_TD_Dark_Y":"G_Con_TD_Light_Y";

		document.all["WagerList"+i].innerHTML = "<a class=\"G_Con_Bet\" href=\"JavaScript: getWagerData("+arrTmpGame[0][1]+","+arrTmpGame[0][2]+",0,0)\">"+arrTmpGame[0][11]+"/"+Math.round(parseFloat(arrTmpGame[0][12])).toString()+"</a>";

		/*with(document.all["JNSort"+i]){
			while(rows.length > 1)	deleteRow(rows.length - 1);
			if(arrJNSort[i].length > 0 && arrJNSort[i][0].length > 0){
				for(j = 0; j < arrJNSort[i].length; j++){
					if(arrJNSort[i][j].length == 0)continue;
					arrDSort = arrJNSort[i][j].split("@");
					newTR = insertRow();
					with(newTR){
						newTD = insertCell();
						newTD.align = "center";
						newTD.innerHTML = j + 1;

						newTD = insertCell();
						newTD.align = "center";
						if(arrDSort[0].length == 1)arrDSort[0] = "0"+arrDSort[0];
						newTD.innerHTML = arrDSort[0];

						newTD = insertCell();
						newTD.align = "right";
						newTD.innerHTML = arrDSort[1];
					}
				}
			}
		}*/
	}  // for(i = 7; i <= 11; i++)
}  // ShowJoinNumberOdds()

function ChangeNumber(intNum){
	var strTmp = "";
	for (var i = 0; i < intNum.length; i++){
		strTmp += intNum.charAt(i).toString();
		if(i % 2 == 1 && i < (intNum.length - 1))strTmp += ",";
	}
	return strTmp.replace("00,", "");
}
//顯示賠率視窗
function ShowOddsLayer(intGID, intBT, intNum, flOdds, intOID, intMaxStake, flStake){
	var strTD = "", arrTmpGame;
	var strSNType = document.getDataForm.SpecialNumType.value;
	WBetTypeTD.innerHTML = (strSNType == "2")?arrBetType[28]:arrBetType[intBT];
	WagerOdds2.style.display = "none";

	document.OddsLayer.Odds2.value = "";
	document.OddsLayer.OddsID2.value = "";	
	switch(parseInt(intBT)){
		case 1:
		case 4:
		case 21:
		case 22:
		case 23:
		case 24:
		case 25:
		case 26:
		case 28:
			strTD = "OddsTD"+intNum;
			if(intSortSite != 0)strTD = "SortTD"+intSortSite;
			break;

		case 2:
		case 5:
			strTD = (intNum == 0)?"OddOddsTD":"EvenOddsTD";
			break;

		case 3:
		case 6:
			strTD = (intNum == 0)?"OverOddsTD":"UnderOddsTD";
			break;

		case 16:
			strTD = (intNum == 0)?"SumOddOddsTD":"SumEvenOddsTD";
			break;

		case 12:
		case 13:
		case 14:
		case 27:
			WBetTypeTD.innerHTML = WBetTypeTD.innerHTML.replace("1-6", (Math.round(intNum / 10)).toString());
			strTD = "OddsTD"+intBT+"_"+intNum;
			break;

		case 8:
		case 10:
			WagerOdds2.style.display = "block";
			arrTmpGame = eval("Game" + intBT);

			if(arrTmpGame.length > 1){
				document.OddsLayer.Odds2.value = arrTmpGame[1][5];
				document.OddsLayer.OddsID2.value = arrTmpGame[1][4];
			}
		case 7:
		case 9:
		case 11:
			strTD = "J-" + intNum;
			intNum = ChangeNumber(intNum);//strTmp.replace("00,", "");
			break;

		default:
			strTD = "OddsTD"+intBT+"_"+intNum;
			break;
	}
	if(intBT == 31){
		WNumberTD.innerHTML = "<input type=\"text\" name=\"JNNum1\" maxlength=\"2\" style=\"width:25px\"><input type=\"text\" name=\"JNNum2\" maxlength=\"2\" style=\"width:25px\"><input type=\"text\" name=\"JNNum3\" maxlength=\"2\" style=\"width:25px\"><input type=\"text\" name=\"JNNum4\" maxlength=\"2\" style=\"width:25px\"><input type=\"text\" name=\"JNNum5\" maxlength=\"2\" style=\"width:25px\">";
	}else if(intBT >= 32 && intBT <= 37){
		var strACon = "";
		for(var i = 1; i <= 12; i++){
			strACon += "<input type='checkbox' name='JNNum" + i + "' value='" + i + "'>" + arrAnimals[i];
			if(i == 6)strACon += "<br />";
		}
		WNumberTD.innerHTML = strACon;
	}else if(intBT >= 38 && intBT <= 43){
		var strACon = "";
		for(var i = 0; i <= 9; i++){
			strACon += "<input type='checkbox' name='JNNum" + i + "' value='" + i + "'>" + i;
			if(i == 4)strACon += "<br />";
		}
		WNumberTD.innerHTML = strACon;
	}else{
		if(intNum.toString() != "")WNumberTD.innerHTML = ChangeType(intBT, intNum);
	}

	if(isNaN(intNum)){
		odds_win.style.top = document.getElementById(strTD).offsetTop + document.getElementById(strTD).clientHeight + 18 + supple_wager_win.offsetTop;
		odds_win.style.left = document.getElementById(strTD).offsetLeft + 2;
	}else{
		if(document.getElementById(strTD)){
			odds_win.style.top = document.getElementById(strTD).offsetTop + document.getElementById(strTD).clientHeight + 56;
			odds_win.style.left = document.getElementById(strTD).offsetLeft;
		}else{
			odds_win.style.top = 175;
			odds_win.style.left = 510;
		}
	}
	if(document.getElementById(strTD) && (document.all.OddsTable.clientWidth < document.getElementById(strTD).offsetLeft + 180)){
		odds_win.style.left = parseInt(odds_win.style.left) + document.getElementById(strTD).clientWidth - 185;
	}

	odds_win.style.display = "block";
	with(document.OddsLayer){
		op.value = "Wager";
		GambleID.value = intGID;
		Bet_Type.value = intBT;
		MaxStake.value = intMaxStake;
		Odds.value = flOdds;
		OddsID.value = intOID;
		StakeMoney.value = (parseInt(flStake) > 0)?Math.floor(parseInt(flStake) / 100)*100:"0";
		Number.value = intNum;
		StakeMoney.focus();
	}
	close_WagerWin();
}
//關閉賠率視窗
function close_MultiOddsWin(){
	multiodds_win.style.display = "none";
}
function open_MultiOddsWin(intBT){
	document.MultiOddsLayer.isRefreshData.value = "1";
	document.getElementById("MultiWagerType").innerHTML = arrBetType[intBT];
	setBalanceCookie(intBT);
	RefreshType();
	document.MultiOddsLayer.Bet_Type.value = intBT;
	multiodds_win.style.display = "block";
	multiodds_win.style.left = 100;
	multiodds_win.style.top = 100;
}
//關閉賠率視窗
function close_OddsWin(){
	odds_win.style.display = "none";
}
//關閉明細視窗
function close_WagerWin(){
	wager_win.style.display = "none";
}
//關閉明細視窗
function close_SuppleWagerWin(){
	supple_wager_win.style.display = "none";
}
//關閉補貨結果視窗
function close_SuppleResultWin(){
	supple_result_win.style.display = "none";
}
function open_SuppleResultWin(){
	supple_result_win.style.top = document.body.scrollTop + 50;
	supple_result_win.style.left = (screen.width - parseInt(supple_result_win.style.width)) / 2;
	supple_result_win.style.display = "block";
}
//取得賠率樣版
function GetTemplate(){
	if(strLayer010203)return;
	with(document.getDataForm){
		op.value = "GetTemplate";
		submit();
	}
}

//取得賠率
function GetOdds(){
	with(document.getDataForm){
		document.getDataForm["Bet_Type"].value = strBetType;
		op.value = "GetOdds";
		submit();
	}
}

/*--判斷特定欄位值是否有填--*/
function isEmpty(str) { 
	for (var i = 0; i < str.length; i++)
		if (" " != str.charAt(i))return false; 
		return true; 
}

function checkOdds(){
	var i, j, arrJNNum = new Array(), strJNum = "";
	var objOdds = document.OddsLayer.Odds;
	var objStakeMoney = document.OddsLayer.StakeMoney;
	var objMaxStake = document.OddsLayer.MaxStake;
	var intBetType = parseInt(document.OddsLayer.Bet_Type.value);
	window.status = document.OddsLayer.Bet_Type.value;
	if(isEmpty(objOdds.value)){
		alert("Odds is Empty");
		objOdds.focus();
		return false;
	}else if(isNaN(objOdds.value)){
		alert("Odds is String!!");
		objOdds.focus();
		return false;
	}else if(parseFloat(objOdds.value) <= 1){
		alert("Odds <= 1");
		objOdds.focus();
		return false;
	}else if(parseFloat(objStakeMoney.value) > parseFloat(objMaxStake.value)){
		alert("Stake Money > "+objMaxStake.value);
		objStakeMoney.focus();
		return false;
	}
	if((intBetType >= 7 && intBetType <= 11) || intBetType == 31){
		if(document.OddsLayer.JNNum1){
			j = 0;
			strJNum = "JNum@";
			for(i = 1; i <= 10; i++){
				if(intBetType == 31 && i > 5)continue;

				if(!isEmpty(document.OddsLayer["JNNum"+i].value)){
					arrJNNum[j] = document.OddsLayer["JNNum"+i].value*1;
					if(arrJNNum[j] < 1 || arrJNNum[j] > 49){
						alert("Number is Error");
						document.OddsLayer["JNNum"+i].focus();
						return false;
					}
					if(strJNum.indexOf("@" + arrJNNum[j] + "@") != -1){
						alert(strNumberDuplicate);
						document.OddsLayer["JNNum"+i].focus();
						return false;
					}
					strJNum += "@" + arrJNNum[j] + "@";
					j++;
				}
			}
			if(arrJNNum.length == 0){
				alert("Number is Empty");
				document.OddsLayer.JNNum1.focus();
				return false;
			}
			document.OddsLayer.Number.value = arrJNNum.join(",");
		}
	}
	close_OddsWin();
	return true;
}

function checkMultiOdds(){
	var i = 0, objOdds, objStake, isStake = false;
	for(i = 1; i < 50; i++){
		objOdds = document.MultiOddsLayer["arrOdds["+i+"]"];
		objStake = document.MultiOddsLayer["arrStake["+i+"]"];
		objMaxStake = document.MultiOddsLayer["arrMaxStake["+i+"]"];
		if(isEmpty(objOdds.value) && !isEmpty(objStake.value)){
			alert("Odds of Number "+i+" is Empty");
			objOdds.focus();
			return false;
		}
		if(!isEmpty(objOdds.value) && !isEmpty(objStake.value)) {
			if(isNaN(objOdds.value)){
				alert("Odds of Number "+i+" is String!!");
				objOdds.focus();
				return false;
			}else if(parseFloat(objOdds.value) <= 1){
				alert("Odds of Number "+i+" <= 1");
				objOdds.focus();
				return false;
			}else if(isNaN(objStake.value)){
				alert("Stake Money of Number "+i+" is String!!");
				objStake.focus();
				return false;
			}else if(parseFloat(objStake.value) <= 0){
				alert("Stake Money of Number "+i+" <= 0");
				objStake.focus();
				return false;
			}else if(parseFloat(objStake.value) > parseFloat(objMaxStake.value)){
				alert("Stake Money of Number "+i+" > "+objMaxStake.value);
				objStake.focus();
				return false;
			}
			isStake = true;
		}	//if(!isEmpty(objOdds.value) && !isEmpty(objStake.value))
	}	//for(i = 1; i < 50; i++)
	if(!isStake){
		alert("Please input Stake Money!!");
		document.MultiOddsLayer["arrStake[1]"].focus();
		return false;
	}
	close_MultiOddsWin();
	return true;
}

//給選擇樂透種類下拉選單用
function LottoSelect(){
	with(document.OddsListForm){
		target = "_self";
		switch(LottoID.value){
			case "1":
				action = "/k_admin/RealSupplement/index.php";
				break;

			case "2":
			case "3":
				action = "/k_admin/RealSupplement3D/index.php";
				break;

			case "7":
				action = "/k_admin/RealSupplement7Star/index.php";
				break;
		}
		submit();
	}
}

//更改下注種類賠率表
function ChangeBet(intBetType){
	close_WagerWin();
	close_SuppleWagerWin();
	close_OddsWin();
	close_MultiOddsWin();
	close_SuppleResultWin();
	document.all["SelectNS"].style.display = "none";
	document.all["SelectSpLine"].style.display = "none";
	document.getDataForm.SpecialNumType.value = "0";
	document.OddsLayer.SpecialNumType.value = "0";
	document.MultiOddsLayer.SpecialNumType.value = "0";
	switch(intBetType){
		//特碼
		case 1:
			document.all["ListStatus"].innerHTML = strT1;
			strBetType = "1,2,3,16";
			document.getDataForm["Bet_Type"].value = "1,2,3,16";
			document.getDataForm["isSpecial"].value = 1;
			document.OddsLayer["isSpecial"].value = 1;
			document.MultiOddsLayer["isSpecial"].value = 1;
			document.all["SelectSpLine"].style.display = "block";
			if(document.getDataForm.SpecialNumType.value == "0"){
				document.getDataForm.SpecialNumType.value = document.all["SelectSpLine"].value;
				document.OddsLayer.SpecialNumType.value = document.all["SelectSpLine"].value;
				document.MultiOddsLayer.SpecialNumType.value = document.all["SelectSpLine"].value;
			}
			iniNumber(1);
			getBalanceCookie(1);
			break;
		//正碼
		case 4:
			document.all["ListStatus"].innerHTML = strT4;
			strBetType = "4,5,6";
			document.getDataForm["Bet_Type"].value = "4,5,6";
			document.getDataForm["isSpecial"].value = 4;
			document.OddsLayer["isSpecial"].value = 4;
			document.MultiOddsLayer["isSpecial"].value = 4;
			iniNumber(4);
			getBalanceCookie(4);
			break;
		//連碼
		case 7:
			document.all["ListStatus"].innerHTML = strT7;
			strBetType = "7,8,9,10,11";
			document.getDataForm["Bet_Type"].value = "7,8,9,10,11";
			document.getDataForm["isSpecial"].value = 0;
			iniJoinNumber();
			getBalanceCookie(intBetType);
			break;
		//正碼 1-6
		case 12:
			document.all["ListStatus"].innerHTML = strT12;
			strBetType = "12,13,14,27";
			document.getDataForm["Bet_Type"].value = "12,13,14,27";
			document.getDataForm["isSpecial"].value = 0;
			iniNormalNumber1_6(0);
			break;
		//正碼 過關
		case 15:
			document.all["ListStatus"].innerHTML = strT15;
			strBetType = "15";
			document.getDataForm["Bet_Type"].value = "15";
			document.getDataForm["isSpecial"].value = 0;
			iniNormalNumber1_6(1);
			break;
		//特碼生肖色波
		case 17:
			document.all["ListStatus"].innerHTML = strT17;
			strBetType = "17,18";
			document.getDataForm["Bet_Type"].value = "17,18";
			document.getDataForm["isSpecial"].value = 0;
			iniAnimalsColor();
			break;
		//一般生肖尾數
		case 19:
			document.all["ListStatus"].innerHTML = strT19;
			strBetType = "19,20";
			document.getDataForm["Bet_Type"].value = "19,20";
			document.getDataForm["isSpecial"].value = 0;
			iniAnimalsMantissa();
			break;
		//正1-6特碼
		case 21:
		case 22:
		case 23:
		case 24:
		case 25:
		case 26:
			if(intBetType == 21)document.all["SelectNS"].selectedIndex = 0;
			document.all["SelectNS"].style.display = "block";
			document.all["ListStatus"].innerHTML = strT21.replace("1", (parseInt(intBetType)%10).toString());
			strBetType = intBetType;
			document.getDataForm["Bet_Type"].value = intBetType;
			document.getDataForm["isSpecial"].value = intBetType;
			document.OddsLayer["isSpecial"].value = intBetType;
			document.MultiOddsLayer["isSpecial"].value = intBetType;
			iniNumber(intBetType);
			getBalanceCookie(intBetType);
			break;
		//特半波
		case 29:
			document.all["ListStatus"].innerHTML = strT29;
			strBetType = "29";
			document.getDataForm["Bet_Type"].value = "29";
			document.getDataForm["isSpecial"].value = 0;
			iniHelfColor();
			break;
		//五不中
		case 31:
			document.all["ListStatus"].innerHTML = strT31;
			strBetType = "31";
			document.getDataForm["Bet_Type"].value = "31";
			document.getDataForm["isSpecial"].value = 31;
			document.OddsLayer["isSpecial"].value = 31;
			iniNumber(31);
			//getBalanceCookie(31);
			break;
		//生肖連
		case 32:
			document.all["ListStatus"].innerHTML = strT32;
			strBetType = "32,33,34,35,36,37";
			document.getDataForm["Bet_Type"].value = "32,33,34,35,36,37";
			document.getDataForm["isSpecial"].value = 0;
			iniBT3243Numer(32);
			break;
		//尾數連
		case 38:
			document.all["ListStatus"].innerHTML = strT38;
			strBetType = "38,39,40,41,42,43";
			document.getDataForm["Bet_Type"].value = "38,39,40,41,42,43";
			document.getDataForm["isSpecial"].value = 0;
			iniBT3243Numer(38);
			break;
	}
}

//更改分盤顯示
function ChangeGambleType(obj){
	with(document.getDataForm){
		ChangeGameType.value = "Yes";
		GameType.value = obj.value;
		submit();
		ChangeGameType.value = "No";
	}
}
//重整方式
function RefreshType(){
	with(document.getDataForm){
		if(op.value == "StartGame"){
			StartGame();
		}else{
			GetOdds();
		}
	}
}
//定時重整
function RClock(i){
	if (RSeconds == 0){
		RefreshType();
		RSeconds = i;
	}
	RSeconds --;
	if(document.all["RSec"])document.all["RSec"].innerHTML = RSeconds;
}
//顯示虛貨，實貨方式
function ChangeReal(obj){
	document.getDataForm.isRealShow.value = 1;//obj.value;
	document.OddsLayer.isRealShow.value = 1;//obj.value;
	RefreshType();
}
//選擇定時時間
function ChangeRefreshSec(obj){
	if(AutoRefreshID > 0)clearInterval(AutoRefreshID);
	AutoRefreshID = setInterval("RClock("+obj.value+")",1000);
}
var KGameDOM;
function getWagerData(GID, BID, Num, isStop) {
	var KGame = new Array(), strTD = "", intGap = 56;
	var objWTable = document.all["WagerTable"];
	var objWLayer = document.all["WagerLayer"];
	var strBID = BID;
	if(BID == 1 || BID == 28){
		var strSNType = document.getDataForm.SpecialNumType.value;
		if(strSNType == "1" || strSNType == "2"){strBID = "1,28";}
	}
	var docloc="getWager.xml.php?GambleID="+GID+"&Bet_Type="+strBID+"&Number="+Num+"&isStop="+isStop+"&isRealShow="+document.getDataForm.isRealShow.value;
	if(document.getDataForm.Bet_Type.value == "15" || (BID >= 31 && BID <= 43))docloc+="&isParlays=1";
	if (document.implementation && document.implementation.createDocument) {
		KGameDOM = document.implementation.createDocument("", "", null);
	} else if (window.ActiveXObject) {
		KGameDOM = new ActiveXObject("Microsoft.XMLDOM");
		KGameDOM.async = false;
	}
	KGameDOM.load(docloc);
	var root = KGameDOM.documentElement;

	if(root != null){
		if(Num == -1){
			strTD = "OddsTD"+BID;
		}else{
			switch(BID){
				case 1:
				case 4:
				case 21:
				case 22:
				case 23:
				case 24:
				case 25:
				case 26:
				case 28:
				case 31:
					strTD = "OddsTD"+Num;
					if(intSortSite != 0)strTD = "SortTD"+intSortSite;
					break;

				case 2:
				case 5:
					strTD = "OddOddsTD";
					intGap += (Num == 1)?45:0;
					break;

				case 3:
				case 6:
					strTD = "OverOddsTD";
					intGap += (Num == 1)?45:0;
					break;

				case 16:
					strTD = "SumOddOddsTD";
					intGap += (Num == 1)?45:0;
					break;

				case 7:
				case 8:
				case 9:
				case 10:
				case 11:
					strTD = "WagerList"+BID;
					break;

				default:
					strTD = "OddsTD"+BID+"_"+Num;
					break;
			}
		}
		wager_win.style.top=document.getElementById(strTD).offsetTop+document.getElementById(strTD).clientHeight+intGap;
		if(document.all.OddsTable.clientWidth < document.getElementById(strTD).offsetLeft + 483){
			wager_win.style.left=document.getElementById(strTD).offsetLeft + document.getElementById(strTD).clientWidth - 487;
		}else{
			wager_win.style.left=document.getElementById(strTD).offsetLeft;
		}
		wager_win.style.display = "block";
		close_OddsWin();
		close_SuppleResultWin();
	}else{
		close_WagerWin();
		close_SuppleResultWin();
		return;
	}
	with(objWTable)	{
		while(rows.length > 1)	deleteRow(rows.length - 1);

		for (var i = 0; i < root.childNodes.length; i++) {
			newTR = insertRow();
			newTR.className = "Account_Con_BG";
			with(newTR){
				if (root.childNodes.item(i).tagName == "WagerData") {
					KGame[i]=root.childNodes.item(i);
					newTD = insertCell();
					newTD.align = "left";
					newTD.innerHTML = KGame[i].getElementsByTagName("BetDate").item(0).text + "&nbsp;" + KGame[i].getElementsByTagName("BetTime").item(0).text + "<br />" + KGame[i].getElementsByTagName("BetNo").item(0).text;

					newTD = insertCell();
					newTD.align = "right";
					newTD.innerHTML = KGame[i].getElementsByTagName("Account").item(0).text;

					newTD = insertCell();
					newTD.innerHTML = KGame[i].getElementsByTagName("Content").item(0).text;

					newTD = insertCell();
					newTD.align = "right";
					if(KGame[i].getElementsByTagName("OneStake").item(0).text != ""){
						newTD.innerHTML = KGame[i].getElementsByTagName("OneStake").item(0).text + "<br /><br />" + KGame[i].getElementsByTagName("Stake").item(0).text;
					}else{
						newTD.innerHTML = KGame[i].getElementsByTagName("Stake").item(0).text;
					}

					newTD = insertCell();
					newTD.align = "right";
					newTD.innerHTML = KGame[i].getElementsByTagName("Income").item(0).text;
				}
			}
		}
	}
	objWLayer.style.height = (objWTable.clientHeight > 300)?300:objWTable.clientHeight;
}

function setBalanceCookie(intBT){
	if(intBT == 711){
		for(var i = 0; i < document.all["JWType"].length; i++){
			if(document.all["JWType"][i].checked)intBT = document.all["JWType"][i].value;

		}
	}
	SetCookie("RSBalanceValue"+intBT, document.all.BalanceValue.value, 1, null, null, null);
	//alert("set"+document.cookie);
}

function getSuppleWagerData() {
	var KGame = new Array(), strTD = "", intGap = 0, strJWType = "";
	var objWTable = document.all["SuppleWagerTable"];
	var objWLayer = document.all["SuppleWagerLayer"];
	for(var i = 0; i < document.all["JWType"].length; i++){
		if(document.all["JWType"][i].checked)strJWType = document.all["JWType"][i].value;
	}
	var arrTmpGame = eval("Game" + strJWType);
	document.all.BalanceOdds.value = arrTmpGame[0][5];
	document.OddsLayer.Odds.value = arrTmpGame[0][5];
	document.OddsLayer.OddsID.value = arrTmpGame[0][4];
	if(arrTmpGame.length > 1){
		document.OddsLayer.Odds2.value = arrTmpGame[1][5];
		document.OddsLayer.OddsID2.value = arrTmpGame[1][4];
	}
	var strGID = document.getDataForm.GambleID.value;
	var strBValue = document.all.BalanceValue.value;
	var strBOdds = document.all.BalanceOdds.value;
	var docloc="getSuppleJW.xml.php?GambleID="+strGID+"&Bet_Type="+strJWType+"&isRealShow="+document.getDataForm.isRealShow.value+"&BValue="+strBValue+"&BOdds="+strBOdds;

	if (document.implementation && document.implementation.createDocument) {
		KGameDOM = document.implementation.createDocument("", "", null);
	} else if (window.ActiveXObject) {
		KGameDOM = new ActiveXObject("Microsoft.XMLDOM");
		KGameDOM.async = false;
	}
	KGameDOM.load(docloc);
	var root = KGameDOM.documentElement;

	if(root != null){
		supple_wager_win.style.display = "block";
		close_OddsWin();
		close_WagerWin();
		close_SuppleResultWin();
	} //if(root != null)

	with(objWTable)	{
		while(rows.length > 1)	deleteRow(rows.length - 1);

		for (var i = 0; i < root.childNodes.length; i++) {
			newTR = insertRow();
			newTR.className = "Account_Con_BG";
			with(newTR){
				if (root.childNodes.item(i).tagName == "WagerData") {
					KGame[i]=root.childNodes.item(i);
					newTD = insertCell();
					newTD.align = "center";
					newTD.innerHTML = (i + 1).toString();

					newTD = insertCell();
					newTD.align = "left";
					newTD.innerHTML = ChangeNumber(KGame[i].getElementsByTagName("Number").item(0).text);

					newTD = insertCell();
					newTD.align = "right";
					newTD.innerHTML = KGame[i].getElementsByTagName("WagerCount").item(0).text;

					newTD = insertCell();
					newTD.align = "right";
					newTD.innerHTML = KGame[i].getElementsByTagName("MemPayOff").item(0).text;
					newTD = insertCell();
					newTD.align = "right";
					newTD.innerHTML = KGame[i].getElementsByTagName("MemPayOff2").item(0).text;

					newTD = insertCell();
					newTD.align = "right";
					newTD.innerHTML = Math.round((parseFloat(KGame[i].getElementsByTagName("MemPayOff").item(0).text) + parseFloat(strBValue)) / parseFloat(strBOdds));

					newTD = insertCell();
					newTD.id = "J-"+KGame[i].getElementsByTagName("Number").item(0).text;
					newTD.align = "center";
					newTD.innerHTML = "<a class=\"G_Con_Odds_NoLink\" href=\"JavaScript:ShowOddsLayer("+strGID+", "+strJWType+", '"+KGame[i].getElementsByTagName("Number").item(0).text+"', "+strBOdds+", '"+arrTmpGame[0][4]+"',"+Math.floor(parseFloat(arrTmpGame[0][8]) - parseFloat(arrTmpGame[0][12]))+")\"><?php print $_strRealSupplement["Supple"];//補貨?></a>";
				}
			}
		}
	}
	objWLayer.style.height = (objWTable.clientHeight > 300)?300:objWTable.clientHeight;
}

function getBalanceCookie(intBT){
	var strT = GetCookie("RSBalanceValue"+intBT);
	if(strT == "" || strT == null){
		document.all.BalanceValue.value = -100000000;
	}else{
		document.all.BalanceValue.value = GetCookie("RSBalanceValue"+intBT);
	}
}

function getQuickBalance() {
	var i = 0, arrTmpGame = new Array(), strJWType = "", strGID = "";
	for( i = 0; i < document.all["JWType"].length; i++){
		if(document.all["JWType"][i].checked)strJWType = document.all["JWType"][i].value;
	}
	strGID = document.getDataForm.GambleID.value;
	arrTmpGame = eval("Game" + strJWType);

	ShowOddsLayer(strGID, strJWType, '', '', '', '');
	document.OddsLayer.Odds.value = arrTmpGame[0][5];
	document.OddsLayer.OddsID.value = arrTmpGame[0][4];
	if(arrTmpGame.length > 1){
		document.OddsLayer.Odds2.value = arrTmpGame[1][5];
		document.OddsLayer.OddsID2.value = arrTmpGame[1][4];
	}else{
		document.OddsLayer.Odds2.value = "";
		document.OddsLayer.OddsID2.value = "";
	}
	//document.all.WNumberTD.innerHTML = "<input type=\"text\" value=\"\" name=\"JNNumber\" size=\"12\">";
	document.all.WNumberTD.innerHTML = "<input type=\"text\" name=\"JNNum1\" maxlength=\"2\" style=\"width:25px\"><input type=\"text\" name=\"JNNum2\" maxlength=\"2\" style=\"width:25px\"><input type=\"text\" name=\"JNNum3\" maxlength=\"2\" style=\"width:25px\"><input type=\"text\" name=\"JNNum4\" maxlength=\"2\" style=\"width:25px\"><input type=\"text\" name=\"JNNum5\" maxlength=\"2\" style=\"width:25px\"><br /><input type=\"text\" name=\"JNNum6\" maxlength=\"2\" style=\"width:25px\"><input type=\"text\" name=\"JNNum7\" maxlength=\"2\" style=\"width:25px\"><input type=\"text\" name=\"JNNum8\" maxlength=\"2\" style=\"width:25px\"><input type=\"text\" name=\"JNNum9\" maxlength=\"2\" style=\"width:25px\"><input type=\"text\" name=\"JNNum10\" maxlength=\"2\" style=\"width:25px\">";
}

//依快速補貨，填入賠率和注額
function inputQMultiStake(){
	var i = 0, strNum = "", arrNum = new Array(), intOverNumber = 0;
	var intLNum = 0, intRNum = 0, intSum = 0;
	if(isGetSuppleOdds != "Y")var strOdds = document.MultiOddsLayer["QOdds"].value;
	var strStake = document.MultiOddsLayer["QStake"].value;

	arrNum = strLottoNum.split(",");//  0 -> 1, 1 -> 2, ...., 48 -> 49
	intOverNumber = (document.getDataForm["isSpecial"].value == "1")?SpecialOverNumber:NormalOverNumber;

	for(i = 0; i < arrNum.length; i++){
		strNum = arrNum[i];
		if(isGetSuppleOdds != "Y")document.MultiOddsLayer["arrOdds["+strNum+"]"].value = "";
		document.MultiOddsLayer["arrStake["+strNum+"]"].value = "";

		//是否紅波
		if(document.MultiOddsLayer["QOType[0]"].checked){
			if(BColor_Index[i] == 0){
				if(isGetSuppleOdds != "Y")document.MultiOddsLayer["arrOdds["+strNum+"]"].value = strOdds;
				document.MultiOddsLayer["arrStake["+strNum+"]"].value = strStake;
			}
		}
		//是否藍波
		if(document.MultiOddsLayer["QOType[1]"].checked){
			if(BColor_Index[i] == 1){
				if(isGetSuppleOdds != "Y")document.MultiOddsLayer["arrOdds["+strNum+"]"].value = strOdds;
				document.MultiOddsLayer["arrStake["+strNum+"]"].value = strStake;
			}
		}
		//是否綠波
		if(document.MultiOddsLayer["QOType[2]"].checked){
			if(BColor_Index[i] == 2){
				if(isGetSuppleOdds != "Y")document.MultiOddsLayer["arrOdds["+strNum+"]"].value = strOdds;
				document.MultiOddsLayer["arrStake["+strNum+"]"].value = strStake;
			}
		}
		//是否單號
		if(document.MultiOddsLayer["QOType[3]"].checked){
			//alert(arrNum[i] + "ss"+parseInt(arrNum[i]));
			if((i+1) % 2 == 1 && (i+1) != 49){
				if(isGetSuppleOdds != "Y")document.MultiOddsLayer["arrOdds["+strNum+"]"].value = strOdds;
				document.MultiOddsLayer["arrStake["+strNum+"]"].value = strStake;
			}
		}
		//是否雙號
		if(document.MultiOddsLayer["QOType[4]"].checked){
			if((i+1) % 2 == 0 && (i+1) != 49){
				if(isGetSuppleOdds != "Y")document.MultiOddsLayer["arrOdds["+strNum+"]"].value = strOdds;
				document.MultiOddsLayer["arrStake["+strNum+"]"].value = strStake;
			}
		}
		//是否大號
		if(document.MultiOddsLayer["QOType[5]"].checked){
			if((i+1) >= intOverNumber && (i+1) != 49){
				if(isGetSuppleOdds != "Y")document.MultiOddsLayer["arrOdds["+strNum+"]"].value = strOdds;
				document.MultiOddsLayer["arrStake["+strNum+"]"].value = strStake;
			}
		}
		//是否小號
		if(document.MultiOddsLayer["QOType[6]"].checked){
			if((i+1) < intOverNumber && (i+1) != 49){
				if(isGetSuppleOdds != "Y")document.MultiOddsLayer["arrOdds["+strNum+"]"].value = strOdds;
				document.MultiOddsLayer["arrStake["+strNum+"]"].value = strStake;
			}
		}
		if(arrNum[i].length < 2)arrNum[i] = "0"+arrNum[i];
	    intLNum = parseInt(arrNum[i].substr(0,1));
	    intRNum = parseInt(arrNum[i].substr(1,1));
	    intSum = intLNum + intRNum;
		//是否合單
		if(document.MultiOddsLayer["QOType[7]"].checked){
			if(intSum % 2 == 1 && (i+1) != 49){
				if(isGetSuppleOdds != "Y")document.MultiOddsLayer["arrOdds["+strNum+"]"].value = strOdds;
				document.MultiOddsLayer["arrStake["+strNum+"]"].value = strStake;
			}
		}
		//是否合雙
		if(document.MultiOddsLayer["QOType[8]"].checked){
			if(intSum % 2 == 0 && (i+1) != 49){
				if(isGetSuppleOdds != "Y")document.MultiOddsLayer["arrOdds["+strNum+"]"].value = strOdds;
				document.MultiOddsLayer["arrStake["+strNum+"]"].value = strStake;
			}
		}
	}
}
//-->
</script>
</head>

<body class="Mybody" onload="ChangeBet(1);">
<form action="index.php" target="_self" method="Get" name="OddsListForm">
<table class="G_Table" cellspacing="1" cellpadding="0">
<tr>
	<td colspan="10" class="MyUp">
		<table width="100%" cellspacing="0" cellpadding="0" border="0">
			<tr>
				<td align="right" class="G_Menu">
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="font-size: 1px">
	<tr>
		<td align="left"><a class="G_text" style="font-size: 13px; font-weight: 700"><?php print $_strRealSupplement["Title"];?></a>&nbsp;&nbsp;&nbsp;&nbsp;<a class="G_text"><?php print $_strRealSupplement["LottoKind"];//種類：?><?php print MakeLottoSelect($_arrLotto, $intLottoID, "LottoID", "LottoSelect()", $_intLang)?></a></td>
		<td align="left">
		<a class="G_text"><?php print $_strRealSupplement["RefreshWay"];//更新：?></a>
		<select onchange="ChangeRefreshSec(this)">
			<option value="">-No-</option>
			<option value="5">5 sec</option>
			<option value="10">10 sec</option>
			<option value="20">20 sec</option>
			<option value="30">30 sec</option>
			<option value="40">40 sec</option>
			<option value="50">50 sec</option>
			<option value="60">60 sec</option>
		</select>&nbsp;<input type="button" class="submit" value="<?php print $_strRealSupplement["Reset"];//重新整理?>" onclick="RefreshType();"> </td>
		<td align="left"><a class="G_text"><?php print $_strRealSupplement["LineKind"];//分盤：?>&nbsp;A</a>
		</td>
		<td align="right" valign="bottom" width="420" style="font-size: 1px">
		<!--########## 特碼 ##########//-->
			<a href="JavaScript:ChangeBet(1)" id="M_OETG" class="while_link"><?php print $_strRealSupplement["SpecialNumber"];//特碼?></a>
		<!--########## 正碼 ##########//-->
			<a class="a_text">&nbsp;|&nbsp;</a>
			<a href="JavaScript:ChangeBet(4)" id="M_CS" class="while_link"><?php print $_strRealSupplement["NormalNumber"];//正碼?></a>
		<!--########## 連碼 ##########//-->
			<a class="a_text">&nbsp;|&nbsp;</a>
			<a href="JavaScript:ChangeBet(7)" id="M_CS" class="while_link"><?php print $_strRealSupplement["JoinNumber"];//連碼?></a>
		<!--########## 正特碼 ##########//-->
			&nbsp;<a class="a_text">|</a>&nbsp;
			<a href="JavaScript:ChangeBet(21)" id="M_CS" class="while_link"><?php print $_strRealSupplement["NormalSpecial"];//正特碼?></a>
		<!--########## 正碼1-6 ##########//-->
			<a class="a_text">&nbsp;|&nbsp;</a>
			<a href="JavaScript:ChangeBet(12)" id="M_CS" class="while_link"><?php print $_strRealSupplement["NormalNumber1_6"];//正碼1-6?></a>
		<!--########## 特碼生肖色波 ##########//-->
			<a class="a_text">&nbsp;|&nbsp;</a>
			<a href="JavaScript:ChangeBet(17)" id="M_CS" class="while_link"><?php print $_strRealSupplement["AnimalsColor"];//特碼生肖色波?></a>
		<!--########## 一般生肖尾數 ##########//-->
			<a class="a_text">&nbsp;|&nbsp;</a>
			<a href="JavaScript:ChangeBet(19)" id="M_CS" class="while_link"><?php print $_strRealSupplement["AnimalsMantissa"];//一般生肖尾數?></a>
		<!--########## 特半波 ##########//-->
			<a class="a_text">&nbsp;|&nbsp;</a>
			<a href="JavaScript:ChangeBet(29)" id="M_CS" class="while_link"><?php print $_strRealSupplement["HelfColor"];//特半波?></a>
		<!--########## 五不中 ##########//-->
			&nbsp;<a class="a_text">|</a>&nbsp;
			<a href="JavaScript:ChangeBet(31)" id="M_CS" class="while_link"><?php print $_strRealSupplement["FiveNotWin"];//五不中?></a>
		<!--########## 生肖連 ##########//-->
			&nbsp;<a class="a_text">|</a>&nbsp;
			<a href="JavaScript:ChangeBet(32)" id="M_CS" class="while_link"><?php print $_strRealSupplement["AnimalsJN"];//生肖連?></a>
		<!--########## 尾數連 ##########//-->
			&nbsp;<a class="a_text">|</a>&nbsp;
			<a href="JavaScript:ChangeBet(38)" id="M_CS" class="while_link"><?php print $_strRealSupplement["MantissaJN"];//尾數連?></a>
		</td>
	</tr>
</table>
				</td>
			</tr>
		</table>
	</td>
</tr>
<tr>
	<td colspan="10" class="G_OutSubMenu">
		<table width="100%" cellspacing="0" cellpadding="0" border="0">
			<tr>
				<td align="right" class="G_SubMenu">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td align="left" class="G_SubMenuCon" width="60%"><?php print $_strRealSupplement["ListStatus"];//目前表單狀態：?><a id="ListStatus" class="G_Sec">Special Ball</a>&nbsp;--&nbsp;<?php print $_strRealSupplement["GameNo"];//期數?><b style="font-size: 16">&nbsp;:&nbsp;</b><a class="G_Sec"><?php print $arrGamble["SerialNo"];?></a>&nbsp;--&nbsp;<?php print $_strRealSupplement["GameTime"];//時間?><b style="font-size: 16">&nbsp;:&nbsp;</b><a class="G_Sec"><?php print $_strGDate;?></a>
		</td>
		<td align="center" class="G_SubMenuCon"><select id="SelectNS" onChange="ChangeBet(parseInt(this.value))" style="display: none;">
		<?php for($i = 1; $i <= 6; $i++)print "<option value='2".$i."'>".str_replace("1",$i, $_strRealSupplement["NormalSpecial1"])."</option>";?></select>
		<select id="SelectSpLine" onChange="document.OddsLayer.SpecialNumType.value=this.value;document.getDataForm.SpecialNumType.value=this.value;document.MultiOddsLayer.SpecialNumType.value=this.value;RefreshType();" style="display: block;">
		<option value='1' selected><?php print $_strRealSupplement["SpecialNumber"];?>A</option>
		<?php if($_KSysParam[isOpenSpecialNumberBLine] == 1){ ?><option value='2'><?php print $_strRealSupplement["SpecialNumber"];?>B</option><?php } ?>
		</select>		
		</td>
		<td align="right" class="G_SubMenuCon"><?php print $_strRealSupplement["RefreshSec"];//更新秒數：?><a class="G_Sec" id="RSec">--</a></td>
	</tr>
</table>
				</td>
			</tr>
		</table>
	</td>
</tr>
<tr>
	<td><span id="BetList"></span></td>
</tr>
</table>
</form>

<!----------------------號碼視窗---------------------------->
<div id="odds_win" style="display: none;position:absolute; z-Index: 5;">
<form name="OddsLayer" action="index.php" method="Get" target="getData" onsubmit="return checkOdds();">
<input type="hidden" name="op" value="Wager">
<input type="hidden" name="rop" value="GetOdds">
<input type="hidden" name="LottoID" value="<?php print $intLottoID;?>">
<input type="hidden" name="SerialNo" value="<?php print $arrGamble["SerialNo"];?>">
<input type="hidden" name="GambleID" value="">
<input type="hidden" name="Bet_Type" value="">
<input type="hidden" name="Number" value="">
<input type="hidden" name="MaxStake" value="">
<input type="hidden" name="isSpecial" value="1">
<input type="hidden" name="isRealShow" value="1">
<input type="hidden" name="isGetSuppleOdds" value="<?php print $_data["isGetSuppleOdds"];?>">
<input type="hidden" name="GameDate" value="<?php print $arrGamble["GameDate"];?>">
<input type="hidden" name="SpecialNumType" value="1">
<table width="260" border="0" cellspacing="1" cellpadding="2" bgcolor="00558E">
<tr>
	<td bgcolor="#FFFFFF">
		<table width="260" border="0" cellspacing="0" cellpadding="0" class="m_tab_fix" >
			<tr bgcolor="0163A2"> 
				<td width="180" style="font-size:12px"><font color="#FFFFFF">&nbsp;Wager</td>
				<td align="right" valign="top" ><a style="cursor:hand;" onClick="close_OddsWin();"><img src="/images/k_admin/edit_dot.gif" width="16" height="14"></a></td>
			</tr>
			<tr bgcolor="#000000"> 
				<td colspan="2" height="1"></td>
			</tr>
        <tr bgcolor="#FFCC66"> 
          <td colspan="2">
		  <table border="0" cellspacing="1" cellpadding="0" width="260" bgcolor="#FFFFFF">
			  <tr bgcolor="#FFCC66" height="22">
				<td width="50" align="center"><?php print $_strRealSupplement["TipKind"];?></td>
				<td width="200" align="left" id="WBetTypeTD" style="font-weight:700; color: #000066; padding-left: 5px">&nbsp;</td>
			  </tr>
			  <tr bgcolor="#FFCC66" height="22">
				<td align="center"><?php print $_strRealSupplement["GameNumber"]?></td>
				<td align="left" id="WNumberTD" style="font-weight:700; color: #000066; padding-left: 5px">&nbsp;</td>
			  </tr>
			  <tr bgcolor="#FFCC66">
				<td align="center"><?php print $_strRealSupplement["WAccount"];?></td>
				<td align="left">&nbsp;<input type="hidden" name="MemID" value="<?php print $_SESSION["Admin_Info"] -> ID;?>"><?php print $_SESSION["Admin_Info"] -> Account;?></td>
			  </tr>
			  <tr bgcolor="#FFCC66">
				<td align="center"><?php print $_strRealSupplement["Odds"]?></td>
				<td align="left">&nbsp;<input type="text" name="Odds" size="5" onpaste="return event.returnValue = false;" onfocus="this.blur()"><input type="hidden" name="OddsID" value=""></td>
			  </tr>
			  <tr bgcolor="#FFCC66" style="display: none" id="WagerOdds2">
				<td align="center"><?php print $_strRealSupplement["Odds2"]?></td>
				<td align="left">&nbsp;<input type="text" name="Odds2" size="5" onpaste="return event.returnValue = false;" onfocus="this.blur()"><input type="hidden" name="OddsID2" value=""></td>
			  </tr>
			  <tr bgcolor="#FFCC66">
				<td align="center"><?php print $_strRealSupplement["WStake"]?></td>
				<td align="left">&nbsp;<input type="text" name="StakeMoney" size="10" onpaste="return event.returnValue = false;"></td>
			  </tr>
			  <tr bgcolor="#FFCC66">
				<td align="center" colspan="2"><input type="submit" class="submit" value="<?php print $_strRealSupplement["Send"];?>"></td>
			  </tr>
		  </table>
		  </td>
        </tr>
      </table>
    </td>
</tr>
</table>
</form>
</div>
<!----------------------號碼視窗----------------------------> 
<!----------------------多號碼視窗---------------------------->
<div id="multiodds_win" style="display: none;position:absolute; z-Index: 6;">
<form name="MultiOddsLayer" action="index.php" method="Post" target="getData" onsubmit="return checkMultiOdds();">
<input type="hidden" name="op" value="MultiWager">
<input type="hidden" name="rop" value="GetOdds">
<input type="hidden" name="isRefreshData" value="0">
<input type="hidden" name="LottoID" value="<?php print $intLottoID;?>">
<input type="hidden" name="SerialNo" value="<?php print $arrGamble["SerialNo"];?>">
<input type="hidden" name="GambleID" value="<?php print $intGID;?>">
<input type="hidden" name="Bet_Type" value="1">
<input type="hidden" name="isSpecial" value="1">
<input type="hidden" name="isRealShow" value="1">
<input type="hidden" name="isGetSuppleOdds" value="<?php print $_data["isGetSuppleOdds"];?>">
<input type="hidden" name="GameDate" value="<?php print $arrGamble["GameDate"];?>">
<input type="hidden" name="SpecialNumType" value="1">
<table border="0" cellspacing="1" cellpadding="2" bgcolor="00558E" width="700">
<tr>
	<td bgcolor="#FFFFFF">
	<table border="0" cellspacing="0" cellpadding="0" class="m_tab_fix" >
	<tr bgcolor="0163A2"> 
		<td style="font-size:12px"><font color="#FFFFFF">&nbsp;Multi Wager</td>
		<td align="right" valign="top" ><a style="cursor:hand;" onClick="close_MultiOddsWin();"><img src="/images/k_admin/edit_dot.gif" width="16" height="14"></a></td>
	</tr>
	<tr bgcolor="#000000"> 
		<td colspan="2" height="1"></td>
	</tr>
	<tr bgcolor="#D8ECE9"> 
		<td colspan="2">
		<table border="0" cellspacing="0" cellpadding="0">
		<tr>
			<td align="left"><table border="0" cellspacing="1" cellpadding="0" style="background-color: #FFFFFF">
			<tr align="center" valign="middle" style="background-color: #D8ECE9; font-size: 12px;">
				<td style="background-color: #7F9DB9;"><?php print $_strRealSupplement["TipKind"];?></td>
				<td width="50" id="MultiWagerType">&nbsp;&nbsp;&nbsp;&nbsp;</td>
				<td style="background-color: #7F9DB9;"><?php print $_strRealSupplement["WAccount"];?></td>
				<td><input type="hidden" name="MemID" value="<?php print $_SESSION["Admin_Info"] -> ID;?>"><?php print $_SESSION["Admin_Info"] -> Account;?></td>
				<td style="background-color: #7F9DB9;"><?php print $_strRealSupplement["WStake"];?></td>
				<td><input type="text" name="QStake" class="s_multi_num_num"></td>
				<td align="left">
					<input type="checkbox" name="QOType[0]" value="Red"><a class="G_Con_Text_red"><?php print $_strRealSupplement["RedBall"];//紅波?></a>
					<input type="checkbox" name="QOType[1]" value="Blue"><a class="G_Con_Text_blue"><?php print $_strRealSupplement["BlueBall"];//藍波?></a>
					<input type="checkbox" name="QOType[2]" value="Green"><a class="G_Con_Text_green"><?php print $_strRealSupplement["GreenBall"];//綠波?></a>
					<input type="checkbox" name="QOType[3]" value="Odd"><a class="G_Con_Text_blue"><?php print $_strRealSupplement["OddBall"];//單號?></a>
					<input type="checkbox" name="QOType[4]" value="Even"><a class="G_Con_Text_blue"><?php print $_strRealSupplement["EvenBall"];//雙號?></a><br />
					<input type="checkbox" name="QOType[5]" value="Over"><a class="G_Con_Text_blue"><?php print $_strRealSupplement["OverBall"];//大號?></a>
					<input type="checkbox" name="QOType[6]" value="Under"><a class="G_Con_Text_blue"><?php print $_strRealSupplement["UnderBall"];//小號?></a>
					<input type="checkbox" name="QOType[7]" value="SumOdd"><a class="G_Con_Text_blue"><?php print $_strRealSupplement["SumOddBall"];//合單?></a>
					<input type="checkbox" name="QOType[8]" value="SumEven"><a class="G_Con_Text_blue"><?php print $_strRealSupplement["SumEvenBall"];//合雙?></a>
					<input type="button" value="Go" class="submit" onclick="inputQMultiStake()">
				</td>
			</tr>
			</table></td>
		</tr>
		<tr>
			<td align="center">
			<table border="0" cellspacing="1" cellpadding="3" style="background-color: #FFFFFF" id="MultiOddsTable">
			<tr align="center" valign="bottom" style="background-color: #7F9DB9; font-size: 12px; height: 16px;">
				<td style="width: 40px;"><?php print $_strRealSupplement["GameNumber"]?></td>
				<td><?php print $_strRealSupplement["Odds"]?></td>
				<td><?php print $_strRealSupplement["WStake"]?></td>
				<td style="width: 40px;"><?php print $_strRealSupplement["GameNumber"]?></td>
				<td><?php print $_strRealSupplement["Odds"]?></td>
				<td><?php print $_strRealSupplement["WStake"]?></td>
				<td style="width: 40px;"><?php print $_strRealSupplement["GameNumber"]?></td>
				<td><?php print $_strRealSupplement["Odds"]?></td>
				<td><?php print $_strRealSupplement["WStake"]?></td>
				<td style="width: 40px;"><?php print $_strRealSupplement["GameNumber"]?></td>
				<td><?php print $_strRealSupplement["Odds"]?></td>
				<td><?php print $_strRealSupplement["WStake"]?></td>
				<td style="width: 40px;"><?php print $_strRealSupplement["GameNumber"]?></td>
				<td><?php print $_strRealSupplement["Odds"]?></td>
				<td><?php print $_strRealSupplement["WStake"]?></td>
			</tr>
			</table>
			</td>
		</tr>
		<tr>
			<td align="center"><input type="submit" class="submit" value="<?php print $_strRealSupplement["Send"];?>"></td>
		</tr>
		</table>
		</td>
	</tr>
	</table>
	</td>
</tr>
</table>
</form>
</div>
<!----------------------多號碼視窗----------------------------> 
<!----------------------下注明細圖層---------------------------->
<div id="wager_win" style="display: none;position:absolute">
<table width="120" border="0" cellspacing="1" cellpadding="2" bgcolor="00558E">
<tr><td bgcolor="#FFFFFF">
<table width="120" border="0" cellspacing="0" cellpadding="0" class="m_tab_fix" >
<tr bgcolor="0163A2"> 
<td width="100" style="font-size:12px"><font color="#FFFFFF">&nbsp;<?php print $_strRealSupplement["WagerList"];?></td>
<td align="right" valign="top" ><a style="cursor:hand;" onClick="close_WagerWin();"><img src="/images/k_admin/edit_dot.gif" width="16" height="14"></a></td>
</tr>
<tr bgcolor="#000000"><td colspan="2" height="1"></td></tr>
<tr bgcolor="#FFCC66"> 
<td colspan="2">
<div style="height:300px; overflow:auto; overflow-x:hidden;" id="WagerLayer">
<table id="WagerTable" class="MyTable" cellspacing="1" cellpadding="3" style="width: 483px;">
<tr align="center">
	<td width="60" class="MyTitleL"><?php print $_strRealSupplement["WGameTime"];?></td>
	<td width="80" class="MyTitleL"><?php print $_strRealSupplement["WAccount"];?></td>
	<td width="170" class="MyTitleL"><?php print $_strRealSupplement["WCont"];?></td>
	<td width="70" class="MyTitleL"><?php print $_strRealSupplement["WStake"];?></td>
	<td width="70" class="MyTitleL"><?php print $_strRealSupplement["WResult"];?></td>
</tr>
</table>
</div>
</td></tr></table>
</td></tr></table>
</div>
<!----------------------下注明細圖層----------------------------> 
<!----------------------連碼補貨圖層---------------------------->
<div id="supple_wager_win" style="display: none; position:absolute; top:175px;">
<table width="120" border="0" cellspacing="1" cellpadding="2" bgcolor="00558E">
<tr><td bgcolor="#FFFFFF">
<table width="120" border="0" cellspacing="0" cellpadding="0" class="m_tab_fix" >
<tr bgcolor="0163A2"> 
<td width="100" style="font-size:12px"><font color="#FFFFFF">&nbsp;<?php print $_strRealSupplement["Supple"];?></td>
<td align="right" valign="top" ><a style="cursor:hand;" onClick="close_SuppleWagerWin();"><img src="/images/k_admin/edit_dot.gif" width="16" height="14"></a></td>
</tr>
<tr bgcolor="#000000"><td colspan="2" height="1"></td></tr>
<tr bgcolor="#FFCC66"> 
<td colspan="2">
<div style="height:327px; overflow:auto; overflow-x:hidden;" id="SuppleWagerLayer">
<table id="SuppleWagerTable" class="MyTable" cellspacing="1" cellpadding="3" style="width: 500px;">
<tr align="center">
	<td width="40" class="MyTitleL">No</td>
	<td width="60" class="MyTitleL"><?php print $_strRealSupplement["GameNumber"];//號碼?></td>
	<td width="60" class="MyTitleL"><?php print $_strRealSupplement["WagerCount"];//累積筆數?></td>
	<td width="100" class="MyTitleL"><?php print $_strRealSupplement["SumPayOff"];//累積派彩?></td>
	<td width="100" class="MyTitleL"><?php print $_strRealSupplement["SumPayOff"];//累積派彩?>2</td>
	<td width="100" class="MyTitleL"><?php print $_strRealSupplement["SuppleSuggest"];//建議補貨?></td>
	<td width="40" class="MyTitleL"><?php print $_strRealSupplement["Supple"];//補貨?></td>
</tr>
</table>
</div>
</td></tr></table>
</td></tr></table>
</div>
<!----------------------外調結果圖層---------------------------->
<div id="supple_result_win" style="display: none;position:absolute; top: 200px; left=200px;width:190px;">
<table width="190" border="0" cellspacing="1" cellpadding="2" bgcolor="00558E">
<tr><td bgcolor="#FFFFFF">
<table width="190" border="0" cellspacing="0" cellpadding="0" class="m_tab_fix" >
<tr bgcolor="0163A2"> 
<td width="100" style="font-size:12px"><font color="#FFFFFF">&nbsp;<?php print $_strRealSupplement["SuppleResult"];?></td>
<td align="right" valign="top" ><a style="cursor:hand;" onClick="close_SuppleResultWin();"><img src="/images/k_admin/edit_dot.gif" width="16" height="14"></a></td>
</tr>
<tr bgcolor="#000000"><td colspan="2" height="1"></td></tr>
<tr bgcolor="#FFCC66"> 
<td colspan="2" id="SuppleResult"></td></tr></table>
</td></tr></table>
</div>
<!----------------------外調結果圖層----------------------------> 
<!----------------------連碼補貨圖層----------------------------> 
<iframe src="" width="50" height="50" name="getData"  frameBorder="0" scrolling="no"></iframe>
<form action="index.php" target="getData" name="getDataForm">
<input type="hidden" name="op" value="GetOdds">
<input type="hidden" name="LottoID" value="<?php print $intLottoID;?>">
<input type="hidden" name="GambleID" value="<?php print $intGID;?>">
<input type="hidden" name="Bet_Type" value="1,2,3,16">
<input type="hidden" name="isSpecial" value="1">
<input type="hidden" name="isStopBet" value="1">
<input type="hidden" name="isRealShow" value="1">
<input type="hidden" name="isGetSuppleOdds" value="<?php print $_data["isGetSuppleOdds"];?>">
<input type="hidden" name="strLottoNumber" value="<?php print $_strNumber;?>">
<input type="hidden" name="ChangeGameType" value="No">
<input type="hidden" name="GameType" value="<?php print $_data["GameType"];?>">
<input type="hidden" name="SpecialNumType" value="1">
</form>
</body>
</html>